Browse Source
Throw an error if trying to access a data variable with undefined em (#6268)
pull/6278/head
mohamed yahia
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
0 deletions
-
packages/core/src/data_sources/model/DataVariable.ts
|
|
@ -37,6 +37,9 @@ export default class DataVariable extends Model { |
|
|
|
|
|
|
|
|
getDataValue() { |
|
|
getDataValue() { |
|
|
const { path, defaultValue } = this.attributes; |
|
|
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); |
|
|
const val = this.em?.DataSources.getValue(path, defaultValue); |
|
|
|
|
|
|
|
|
return val; |
|
|
return val; |
|
|
|