From fa3a2c1c5e423f0a895f900514d375f0a11cf75a Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 30 Sep 2014 21:20:47 -0700 Subject: [PATCH] don't crash if somehow a game gets opened without a dict --- xwords4/android/XWords4/jni/drawwrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xwords4/android/XWords4/jni/drawwrapper.c b/xwords4/android/XWords4/jni/drawwrapper.c index 6a801562c..1d697ce83 100644 --- a/xwords4/android/XWords4/jni/drawwrapper.c +++ b/xwords4/android/XWords4/jni/drawwrapper.c @@ -518,9 +518,9 @@ static void and_draw_dictChanged( DrawCtx* dctx, XP_S16 playerNum, const DictionaryCtxt* dict ) { - XP_LOGF( "%s(dict=%p); code=%x", __func__, dict, andDictID(dict) ); AndDraw* draw = (AndDraw*)dctx; - if ( NULL != draw->jdraw ) { + if ( !!dict && !!draw->jdraw ) { + XP_LOGF( "%s(dict=%p); code=%x", __func__, dict, andDictID(dict) ); XP_LangCode code = 0; /* A null dict means no-lang */ if ( NULL != dict ) { code = dict_getLangCode( dict );