diff --git a/package/android/src/main/cpp/frameprocessors/VisionCameraProxy.cpp b/package/android/src/main/cpp/frameprocessors/VisionCameraProxy.cpp index 6476bd1964..708ae86cd9 100644 --- a/package/android/src/main/cpp/frameprocessors/VisionCameraProxy.cpp +++ b/package/android/src/main/cpp/frameprocessors/VisionCameraProxy.cpp @@ -53,6 +53,9 @@ jsi::Value VisionCameraProxy::initFrameProcessorPlugin(jsi::Runtime& runtime, co auto options = JSIJNIConversion::convertJSIObjectToJNIMap(runtime, jsOptions); auto plugin = _javaProxy->cthis()->initFrameProcessorPlugin(name, options); + if (plugin == nullptr) { + return jsi::Value::undefined(); + } auto pluginHostObject = std::make_shared(plugin); return jsi::Object::createFromHostObject(runtime, pluginHostObject); diff --git a/package/example/android/app/src/main/java/com/mrousavy/camera/example/MainApplication.kt b/package/example/android/app/src/main/java/com/mrousavy/camera/example/MainApplication.kt index 12650b3771..e679623704 100644 --- a/package/example/android/app/src/main/java/com/mrousavy/camera/example/MainApplication.kt +++ b/package/example/android/app/src/main/java/com/mrousavy/camera/example/MainApplication.kt @@ -17,7 +17,7 @@ import com.mrousavy.camera.frameprocessors.FrameProcessorPluginRegistry class MainApplication : Application(), ReactApplication { companion object { init { - FrameProcessorPluginRegistry.addFrameProcessorPlugin("example") { proxy, args -> ExampleFrameProcessorPlugin(proxy, args) } + FrameProcessorPluginRegistry.addFrameProcessorPlugin("example_plugin") { proxy, args -> ExampleFrameProcessorPlugin(proxy, args) } FrameProcessorPluginRegistry.addFrameProcessorPlugin("example_kotlin_swift_plugin") { proxy, args -> ExampleKotlinFrameProcessorPlugin(proxy, args) } } }