Add a null check in DummySurface static initializer

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157958694
This commit is contained in:
andrewlewis 2017-06-04 07:02:13 -07:00 committed by Oliver Woodman
parent 9796a09698
commit cc748c30c7

View file

@ -76,7 +76,7 @@ public final class DummySurface extends Surface {
if (Util.SDK_INT >= 17) { if (Util.SDK_INT >= 17) {
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
String extensions = EGL14.eglQueryString(display, EGL10.EGL_EXTENSIONS); String extensions = EGL14.eglQueryString(display, EGL10.EGL_EXTENSIONS);
SECURE_SUPPORTED = extensions.contains("EGL_EXT_protected_content"); SECURE_SUPPORTED = extensions != null && extensions.contains("EGL_EXT_protected_content");
} else { } else {
SECURE_SUPPORTED = false; SECURE_SUPPORTED = false;
} }