Skip to content

Commit 8fc5f9b

Browse files
buuhuuPeterStaev
authored andcommitted
added a null check in the onOrientationChanged() listener implementation (#12)
1 parent 93afead commit 8fc5f9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

image-swipe.android.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,10 @@ class OrientationListener extends android.view.OrientationEventListener {
481481
}
482482

483483
public onOrientationChanged(orientation: number) {
484-
this._zoomImageView.get().reset(true);
484+
const zoomImageView: ZoomImageView = this._zoomImageView.get();
485+
if (zoomImageView) {
486+
zoomImageView.reset(true);
487+
}
485488
}
486489
}
487490

0 commit comments

Comments
 (0)