Skip to content

Commit

Permalink
fix: Fix not-found plugins crashing the app (#3076)
Browse files Browse the repository at this point in the history
* fix: Fix not-found plugins crashing the app

* fix: Fix Example Plugin wrong name

* Update VisionCameraProxy.cpp
  • Loading branch information
mrousavy authored Jul 12, 2024
1 parent 4754065 commit 38199e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<FrameProcessorPluginHostObject>(plugin);
return jsi::Object::createFromHostObject(runtime, pluginHostObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}
}
Expand Down

0 comments on commit 38199e2

Please sign in to comment.