Skip to content

Commit

Permalink
Throw an error if trying to access a data variable with undefined em (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsalem401 authored Oct 28, 2024
1 parent e43dcfc commit 2055896
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/data_sources/model/DataVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export default class DataVariable extends Model {

getDataValue() {
const { path, defaultValue } = this.attributes;
if (!this.em) {
throw new Error('EditorModel instance is not provided for a data variable.');
}
const val = this.em?.DataSources.getValue(path, defaultValue);

return val;
Expand Down

0 comments on commit 2055896

Please sign in to comment.