From 83a5d32ed0806207e3844bed6e924b67bfa857ea Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 20 Apr 2020 21:27:26 -0700 Subject: [PATCH] check for null --- .../main/java/org/eehouse/android/xw4/jni/JNIThread.java | 8 ++++++-- xwords4/android/app/src/main/res/values/strings.xml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/JNIThread.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/JNIThread.java index 4aa9d05a5..b0dbb5163 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/JNIThread.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/JNIThread.java @@ -197,9 +197,13 @@ public class JNIThread extends Thread implements AutoCloseable { m_queue.clear(); } + boolean success = false; + DictUtils.DictPairs pairs = null; String[] dictNames = GameUtils.dictNames( context, m_lock ); - DictUtils.DictPairs pairs = DictUtils.openDicts( context, dictNames ); - boolean success = !pairs.anyMissing( dictNames ); + if ( null != dictNames ) { + pairs = DictUtils.openDicts( context, dictNames ); + success = !pairs.anyMissing( dictNames ); + } if ( success ) { byte[] stream = GameUtils.savedGame( context, m_lock ); diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 3f969ab82..670eb6505 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -2527,7 +2527,7 @@ another crash. Do you want to open it anyway? Open anyway - Word %1$s not found in wordlist %2$s + Word %1$s not found in wordlist %2$s. Debug logs