Commit fafa35cb authored by Biao She's avatar Biao She Committed by Commit Bot

Fix a crash due to NullPointerException

This NullPointerException should be really rare. There is a fix on
the way, for now we just catch the exception to prevent crash.

Bug: 842059
Change-Id: Ie130d887d303e7f08504b8c783ae43b87ed31ccf
Reviewed-on: https://chromium-review.googlesource.com/1057427Reviewed-by: default avatarAmirhossein Simjour <asimjour@chromium.org>
Commit-Queue: Biao She <bshe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558398}
parent b7c825d7
......@@ -75,7 +75,12 @@ public class VrClassesWrapperImpl implements VrClassesWrapper {
Context context = ContextUtils.getApplicationContext();
// The call to isInVrSession crashes when called on a non-Daydream ready device, so we add
// the device check (b/77268533).
return isDaydreamReadyDevice() && DaydreamApi.isInVrSession(context);
try {
return isDaydreamReadyDevice() && DaydreamApi.isInVrSession(context);
} catch (Exception ex) {
Log.e(TAG, "Unable to check if in vr session", ex);
return false;
}
}
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment