From d9ed84853eeb8ffcbfe645bd5460afa554dad271 Mon Sep 17 00:00:00 2001 From: "Randall E. Barker" Date: Thu, 21 May 2020 13:36:06 -0700 Subject: [PATCH] Ensure GeckoSession is not null in cleanResources (#3400) --- .../shared/org/mozilla/vrbrowser/browser/engine/Session.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java index f234ff47d..d985b4692 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java @@ -609,7 +609,9 @@ public CompletableFuture captureBackgroundBitmap(int displayWidth, int dis Runnable cleanResources = () -> { display.surfaceDestroyed(); - mState.mSession.releaseDisplay(display); + if (mState.mSession != null) { + mState.mSession.releaseDisplay(display); + } BitmapCache.getInstance(mContext).releaseCaptureSurface(); };