summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2015-10-03 21:51:17 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2015-10-03 22:54:38 +0200
commitcdfdf76787b1c3983e4eae0620fe711647ed0b9e (patch)
tree838c7cfc3ae66375b4d232fa8ef35cc88fbf7b83
parent233b9b0ec95069b5ce98aab942304459ca7344a8 (diff)
android: avoid arrayIndexOutOfBounds when lokit payload doesn't have a value
and is not handled yet like ".uno:CharFontName=" Change-Id: I09d17b6be9ce9b9c9ae6883f8222c8628268815d
-rw-r--r--android/source/src/java/org/libreoffice/InvalidationHandler.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/android/source/src/java/org/libreoffice/InvalidationHandler.java b/android/source/src/java/org/libreoffice/InvalidationHandler.java
index fd382db11ddb..32fe8530671f 100644
--- a/android/source/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/source/src/java/org/libreoffice/InvalidationHandler.java
@@ -84,6 +84,10 @@ public class InvalidationHandler implements Document.MessageCallback {
private void stateChanged(String payload) {
String[] parts = payload.split("=");
+ if (parts.length < 2) {
+ Log.e(LOGTAG, "LOK_CALLBACK_STATE_CHANGED unexpected payload: " + payload);
+ return;
+ }
boolean pressed = Boolean.parseBoolean(parts[1]);
if (parts[0].equals(".uno:Bold")) {
LOKitShell.getToolbarController().onToggleStateChanged(Document.BOLD, pressed);