From 685acaf6ad73a5f923319d5012cdaa640407ef89 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Wed, 3 Aug 2022 17:00:21 +0200 Subject: [PATCH] Fix Null Pointer Exception --- .../src/main/java/org/microg/gms/gcm/McsService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java index 2142648b1..389f6296c 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java @@ -490,7 +490,10 @@ public class McsService extends Service implements Handler.Callback { NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo(); activeNetworkPref = GcmPrefs.get(this).getNetworkPrefForInfo(activeNetworkInfo); if (!GcmPrefs.get(this).isEnabledFor(activeNetworkInfo)) { - logd(this, "Don't connect, because disabled for " + activeNetworkInfo.getTypeName()); + final String typeName = + activeNetworkInfo != null ? activeNetworkInfo.getTypeName() : ""; + + logd(this, "Don't connect, because disabled for " + typeName); scheduleReconnect(this); return; } -- GitLab