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

Commit 249fe083 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correctly handle a null surface"

parents 6d60e86b 0fe97543
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();