From 10a0e33ee44f2f4d2b9f5e7590632734a08674ec Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 15 Aug 2016 07:19:05 -0700 Subject: [PATCH] send cancel if no dict's been chosen Fix crash when game config opens dict download for result and nothing's chosen. Was sending Activity.RESULT_OK in that case instead of RESULT_CANCELED. --- .../src/org/eehouse/android/xw4/DictsDelegate.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java index e89589a33..89f41d4f0 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DictsDelegate.java @@ -577,14 +577,14 @@ public class DictsDelegate extends ListDelegateBase if ( handled ) { clearSelections(); } else { - Intent intent = new Intent(); - if ( null != m_lastLang ) { + if ( null != m_lastLang && null != m_lastDict ) { + Intent intent = new Intent(); intent.putExtra( RESULT_LAST_LANG, m_lastLang ); - } - if ( null != m_lastDict ) { intent.putExtra( RESULT_LAST_DICT, m_lastDict ); + setResult( Activity.RESULT_OK, intent ); + } else { + setResult( Activity.RESULT_CANCELED ); } - setResult( Activity.RESULT_OK, intent ); } return handled; }