Skip to content

Commit a44c9f9

Browse files
author
Nedyalko Nikolov
committed
Added some checks for binding infrastructure.
1 parent 79f009f commit a44c9f9

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

ui/core/bindable.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ export class Binding {
258258
}
259259
result.push({ instance: currentObject, property: objProp });
260260
if (!currentObjectChanged) {
261-
currentObject = currentObject[propsArray[i]];
262-
currentObjectChanged = false;
261+
currentObject = currentObject ? currentObject[propsArray[i]] : null;
263262
}
263+
currentObjectChanged = false;
264264
}
265265
return result;
266266
}
@@ -273,7 +273,7 @@ export class Binding {
273273
for (i = 0; i < objectsAndPropertiesLength; i++) {
274274
var prop = objectsAndProperties[i].property;
275275
var currentObject = objectsAndProperties[i].instance;
276-
if (!this.propertyChangeListeners[prop] && currentObject instanceof observable.Observable) {
276+
if (currentObject && !this.propertyChangeListeners[prop] && currentObject instanceof observable.Observable) {
277277
weakEvents.addWeakEventListener(
278278
currentObject,
279279
observable.Observable.propertyChangeEvent,
@@ -563,14 +563,14 @@ export class Binding {
563563
if (objectsAndProperties.length > 0) {
564564
var resolvedObj = objectsAndProperties[objectsAndProperties.length - 1].instance;
565565
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+
}
569571
}
570572
}
571-
else {
572-
return null;
573-
}
573+
return null;
574574
}
575575

576576
private updateOptions(options: { instance: WeakRef<any>; property: any }, value: any) {

ui/list-view/list-view.ios.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ export class ListView extends common.ListView {
206206
this._ios.registerClassForCellReuseIdentifier(ListViewCell.class(), CELLIDENTIFIER);
207207
this._ios.autoresizingMask = UIViewAutoresizing.UIViewAutoresizingNone;
208208
this._ios.estimatedRowHeight = DEFAULT_HEIGHT;
209+
this._ios.rowHeight = UITableViewAutomaticDimension;
209210
this._ios.dataSource = this._dataSource = DataSource.initWithOwner(new WeakRef(this));
210211
this._delegate = UITableViewDelegateImpl.initWithOwner(new WeakRef(this));
211212
this._heights = new Array<number>();

0 commit comments

Comments
 (0)