Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fe97543 authored by Ilya Matyukhin's avatar Ilya Matyukhin
Browse files

Correctly handle a null surface

Bug: 150966034
Test: Manual, with a biometrics.face@1.1 HAL
Change-Id: I6a8bab0a6ac2df2c1900481da5264e0bd29b8e18
parent e4c6b835
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ using ::android::sp;

static jobject convertSurfaceToNativeHandle(JNIEnv* env, jobject /* clazz */,
                                            jobject previewSurface) {
    if (previewSurface == nullptr) {
        return nullptr;
    }
    ANativeWindow* previewAnw = ANativeWindow_fromSurface(env, previewSurface);
    sp<Surface> surface = static_cast<Surface*>(previewAnw);
    sp<IGraphicBufferProducer> igbp = surface->getIGraphicBufferProducer();