Explorar el Código

Fix KEYGUARD_SERVICE might not be available

Sebastián Katzer hace 8 años
padre
commit
cf99f31e6d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/android/LocalNotification.java

+ 1 - 1
src/android/LocalNotification.java

@@ -575,7 +575,7 @@ public class LocalNotification extends CordovaPlugin {
                 .getSystemService(Context.KEYGUARD_SERVICE);
 
         //noinspection SimplifiableIfStatement
-        if (km.isKeyguardLocked())
+        if (km != null && km.isKeyguardLocked())
             return false;
 
         return view.getView().getWindowVisibility() == View.VISIBLE;