Fix crash when enabling vanity camera before capturer initialization.

This commit is contained in:
Alex Hart authored and GitHub committed 2026-02-27 16:35:39 -04:00
1 parent 0bf54e6b45
commit 58ab03b4e3
1 file changed
+2 -1
@@ -87,6 +87,7 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
new CameraCapturerWrapper(observer));
capturer.setOrientation(orientation);
isInitialized = true;
setEnabled(enabled);
});
}
}
@@ -120,7 +121,7 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
this.enabled = enabled;
if (capturer == null) {
if (capturer == null || !isInitialized) {
return;
}