@@ -100,12 +100,12 @@ ObjectFrame.prototype.loadDataFrames = function (frames) {
100
100
for ( let i = 0 ; i < frames . length ; i += 1 ) {
101
101
if ( frames [ i ] [ '@context' ] ) this . jsonld_context = frames [ i ] [ '@context' ] ;
102
102
let cframe = this . getPropertyClassFrame ( frames [ i ] . property , frames [ i ] ) ;
103
- if ( cframe . isClassChoice ( ) ) {
103
+ if ( cframe && cframe . isClassChoice ( ) ) {
104
104
cframe = cframe . getChosenClassFrame ( frames [ i ] . range ) ;
105
105
if ( ! cframe ) {
106
106
console . log ( `no choice frame ${ frames [ i ] . range } ` ) ;
107
107
}
108
- } else if ( cframe . isLogic ( ) ) {
108
+ } else if ( cframe && cframe . isLogic ( ) ) {
109
109
cframe = cframe . getChosenFrame ( frames [ i ] ) ;
110
110
}
111
111
if ( cframe ) {
@@ -246,7 +246,12 @@ ObjectFrame.prototype.getMissingPropertyList = function () {
246
246
const nmissing = [ ] ;
247
247
for ( let i = 0 ; i < missing . length ; i ++ ) {
248
248
const cframe = this . getPropertyClassFrame ( missing [ i ] ) ;
249
- const newb = { label : cframe . getLabel ( ) , value : missing [ i ] } ;
249
+ if ( cframe ) {
250
+ var newb = { label : cframe . getLabel ( ) , value : missing [ i ] } ;
251
+ }
252
+ else {
253
+ var newb = { label : missing [ i ] , value : missing [ i ] } ;
254
+ }
250
255
nmissing . push ( newb ) ;
251
256
}
252
257
return nmissing ;
@@ -260,7 +265,12 @@ ObjectFrame.prototype.getFilledPropertyList = function () {
260
265
const filled = [ ] ;
261
266
for ( let i = 0 ; i < props . length ; i ++ ) {
262
267
const cframe = this . getPropertyClassFrame ( props [ i ] ) ;
263
- const newb = { label : cframe . getLabel ( ) , value : props [ i ] } ;
268
+ if ( cframe ) {
269
+ var newb = { label : cframe . getLabel ( ) , value : props [ i ] } ;
270
+ }
271
+ else {
272
+ var newb = { label : props [ i ] , value : props [ i ] } ;
273
+ }
264
274
filled . push ( newb ) ;
265
275
}
266
276
return filled ;
@@ -546,7 +556,7 @@ PropertyFrame.prototype.addFrame = function (frame) {
546
556
var df = new DataFrame ( frame , this , this . values . length ) ;
547
557
this . values . push ( df ) ;
548
558
} else {
549
- const kid = new ObjectFrame ( this . range ( ) , cframe . frame , frame . frame , this , frame ) ;
559
+ const kid = new ObjectFrame ( this . range ( ) , this . cframe . frame , frame . frame , this , frame ) ;
550
560
this . values . push ( kid ) ;
551
561
}
552
562
} ;
0 commit comments