From ff890abebf2145e8c97b94f01b48d22b47b48bea Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Wed, 19 May 2021 10:13:20 +0200 Subject: [PATCH] fix: Frame Processor error when frame processors aren't used --- src/Camera.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Camera.tsx b/src/Camera.tsx index 1db4d15..9c1e938 100644 --- a/src/Camera.tsx +++ b/src/Camera.tsx @@ -343,9 +343,11 @@ export class Camera extends React.PureComponent { * @internal */ componentWillUnmount(): void { - this.assertFrameProcessorsEnabled(); - // @ts-expect-error JSI functions aren't typed - global.unsetFrameProcessor(this.handle); + if (this.lastFrameProcessor != null || this.props.frameProcessor != null) { + this.assertFrameProcessorsEnabled(); + // @ts-expect-error JSI functions aren't typed + global.unsetFrameProcessor(this.handle); + } } /**