@@ -258,9 +258,9 @@ export class Binding {
258
258
}
259
259
result . push ( { instance : currentObject , property : objProp } ) ;
260
260
if ( ! currentObjectChanged ) {
261
- currentObject = currentObject [ propsArray [ i ] ] ;
262
- currentObjectChanged = false ;
261
+ currentObject = currentObject ? currentObject [ propsArray [ i ] ] : null ;
263
262
}
263
+ currentObjectChanged = false ;
264
264
}
265
265
return result ;
266
266
}
@@ -273,7 +273,7 @@ export class Binding {
273
273
for ( i = 0 ; i < objectsAndPropertiesLength ; i ++ ) {
274
274
var prop = objectsAndProperties [ i ] . property ;
275
275
var currentObject = objectsAndProperties [ i ] . instance ;
276
- if ( ! this . propertyChangeListeners [ prop ] && currentObject instanceof observable . Observable ) {
276
+ if ( currentObject && ! this . propertyChangeListeners [ prop ] && currentObject instanceof observable . Observable ) {
277
277
weakEvents . addWeakEventListener (
278
278
currentObject ,
279
279
observable . Observable . propertyChangeEvent ,
@@ -563,14 +563,14 @@ export class Binding {
563
563
if ( objectsAndProperties . length > 0 ) {
564
564
var resolvedObj = objectsAndProperties [ objectsAndProperties . length - 1 ] . instance ;
565
565
var prop = objectsAndProperties [ objectsAndProperties . length - 1 ] . property ;
566
- return {
567
- instance : new WeakRef ( resolvedObj ) ,
568
- property : prop
566
+ if ( resolvedObj ) {
567
+ return {
568
+ instance : new WeakRef ( resolvedObj ) ,
569
+ property : prop
570
+ }
569
571
}
570
572
}
571
- else {
572
- return null ;
573
- }
573
+ return null ;
574
574
}
575
575
576
576
private updateOptions ( options : { instance : WeakRef < any > ; property : any } , value : any ) {
0 commit comments