1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-02-07 12:03:28 +01:00

Fix NPE on Wallpaper Service

This commit is contained in:
Michel Roux 2020-04-27 15:01:01 +02:00
parent e2acc418d4
commit fe0d6a88aa

View File

@ -115,10 +115,12 @@ public class NyanWallpaperService extends WallpaperService implements NyanConsta
private void updateHelperState() {
final PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
if (pm.isScreenOn()) {
mHelper.start();
} else {
mHelper.stop();
if (pm != null) {
if (pm.isScreenOn()) {
mHelper.start();
} else {
mHelper.stop();
}
}
}