Skip to content

Commit 0ac6cba

Browse files
authored
fix: prevent error if OnLayout is called after unload
1 parent 7129731 commit 0ac6cba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zoomimage/index.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ export class ZoomImg extends ZoomImageBase {
5959

6060
public onLayout(left: number, top: number, right: number, bottom: number): void {
6161
super.onLayout(left, top, right, bottom);
62-
this.nativeImageViewProtected.frame = this.nativeViewProtected.bounds;
62+
if (this.nativeViewProtected) {
63+
this.nativeImageViewProtected.frame = this.nativeViewProtected.bounds;
64+
}
6365
}
6466

6567
[zoomScaleProperty.setNative](scale: number) {

0 commit comments

Comments
 (0)