Fix crash when enabling vanity camera before capturer initialization.

This commit is contained in:
Alex Hart
2026-02-27 16:35:39 -04:00
committed by GitHub
parent 0bf54e6b45
commit 58ab03b4e3

View File

@@ -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;
}