From ea3e736a14f7d5149e4d8e77b38abc1fc510a568 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 31 Oct 2016 11:13:48 +0800 Subject: [PATCH] Fix null reference crash --- .../main/java/com/topjohnwu/magisk/SplashActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java b/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java index 673c10149..6685b48e3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/SplashActivity.java @@ -5,6 +5,7 @@ import android.content.SharedPreferences; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; +import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import com.topjohnwu.magisk.utils.Async; @@ -12,12 +13,16 @@ import com.topjohnwu.magisk.utils.Logger; import com.topjohnwu.magisk.utils.Shell; import com.topjohnwu.magisk.utils.Utils; +import java.util.Collection; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Set; public class SplashActivity extends AppCompatActivity { -private SharedPreferences prefs; + + private SharedPreferences prefs; + @Override protected void onCreate(Bundle savedInstanceState) { @@ -59,7 +64,7 @@ private SharedPreferences prefs; private void setupHideLists() { - Set set = null; + Set set = new HashSet<>(); Set setOriginal = null; List hideList = null; List addList = null;