@@ -100,12 +100,12 @@ ObjectFrame.prototype.loadDataFrames = function (frames) {
100100 for ( let i = 0 ; i < frames . length ; i += 1 ) {
101101 if ( frames [ i ] [ '@context' ] ) this . jsonld_context = frames [ i ] [ '@context' ] ;
102102 let cframe = this . getPropertyClassFrame ( frames [ i ] . property , frames [ i ] ) ;
103- if ( cframe . isClassChoice ( ) ) {
103+ if ( cframe && cframe . isClassChoice ( ) ) {
104104 cframe = cframe . getChosenClassFrame ( frames [ i ] . range ) ;
105105 if ( ! cframe ) {
106106 console . log ( `no choice frame ${ frames [ i ] . range } ` ) ;
107107 }
108- } else if ( cframe . isLogic ( ) ) {
108+ } else if ( cframe && cframe . isLogic ( ) ) {
109109 cframe = cframe . getChosenFrame ( frames [ i ] ) ;
110110 }
111111 if ( cframe ) {
@@ -246,7 +246,12 @@ ObjectFrame.prototype.getMissingPropertyList = function () {
246246 const nmissing = [ ] ;
247247 for ( let i = 0 ; i < missing . length ; i ++ ) {
248248 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+ }
250255 nmissing . push ( newb ) ;
251256 }
252257 return nmissing ;
@@ -260,7 +265,12 @@ ObjectFrame.prototype.getFilledPropertyList = function () {
260265 const filled = [ ] ;
261266 for ( let i = 0 ; i < props . length ; i ++ ) {
262267 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+ }
264274 filled . push ( newb ) ;
265275 }
266276 return filled ;
@@ -546,7 +556,7 @@ PropertyFrame.prototype.addFrame = function (frame) {
546556 var df = new DataFrame ( frame , this , this . values . length ) ;
547557 this . values . push ( df ) ;
548558 } 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 ) ;
550560 this . values . push ( kid ) ;
551561 }
552562} ;
0 commit comments