Skip to content

Commit b1bd2fa

Browse files
author
farfromrefug
committed
fix(ios): prevent error on unload
1 parent 8d965cf commit b1bd2fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ui-cameraview/index.ios.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,16 @@ export class CameraView extends CameraViewBase {
210210
}
211211
onLoaded(): void {
212212
super.onLoaded();
213-
if (this.processor) {
213+
if (this.nativeViewProtected && this.processor) {
214214
this.nativeViewProtected.processingDelegate = this.processor;
215215
}
216216
this.startPreview();
217217
}
218218
onUnloaded(): void {
219219
this.stopPreview();
220-
this.nativeViewProtected.processingDelegate = null;
220+
if (this.nativeViewProtected) {
221+
this.nativeViewProtected.processingDelegate = null;
222+
}
221223
super.onUnloaded();
222224
}
223225
previewStarted = false;

0 commit comments

Comments
 (0)