diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/TetheringDialog.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/TetheringDialog.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/TetheringDialog.java index 675f1a61..e747d5b4 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/TetheringDialog.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/TetheringDialog.java @@ -209,10 +209,18 @@ public class TetheringDialog extends AppCompatDialogFragment implements Observer int endIndex = 0; if (matcher.matches()) { startIndex = matcher.start(2); - endIndex = startIndex + matcher.group(3).length(); + try { + endIndex = startIndex + matcher.group(3).length(); + } catch (NullPointerException npe) { + endIndex = -1; + } } systemSettingsMessage = systemSettingsMessage.replace("<b>", "").replace("</b>", ""); String wholeMessage = systemSettingsMessage + "\n\n" + tetheringMessage; + if (startIndex == -1 || endIndex == -1) { + Log.e(TAG, "Tethering string has wrong formatting!"); + return wholeMessage; + } Spannable spannable = new SpannableString(wholeMessage); spannable.setSpan(new ClickableSpan() { @Override |