diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 6a5a39edb..106958097 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -617,7 +617,11 @@ status_t SurfaceFlinger::getDisplayStats(const sp& /* display */, } int SurfaceFlinger::getActiveConfig(const sp& display) { - return getDisplayDevice(display)->getActiveConfig(); + sp device(getDisplayDevice(display)); + if (device != NULL) { + return device->getActiveConfig(); + } + return BAD_VALUE; } void SurfaceFlinger::setActiveConfigInternal(const sp& hw, int mode) {