[Libreoffice-commits] .: android/sdremote

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 19 02:47:24 PDT 2012


 android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java |    5 +++++
 android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java     |    7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit b1cd18bcd1d93c72c6ce84de42e58046bdaf8d1d
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Wed Sep 19 11:44:59 2012 +0200

    Return empty string for null notes to avoid showing null in UI.
    
    Change-Id: I1f60ce48d9d11b074aa268eda118c427b3cc62c0

diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java
index 09bf160..ff49a53 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java
@@ -56,6 +56,11 @@ public class NetworkClient extends Client {
         // Wait until we get the appropriate string back...
         String aTemp = mReader.readLine();
 
+        if (aTemp == null) {
+            throw new IOException(
+                            "End of stream reached before any data received.");
+        }
+
         while (!aTemp.equals("LO_SERVER_SERVER_PAIRED")) {
             if (aTemp.equals("LO_SERVER_VALIDATING_PIN")) {
                 // Broadcast that we need a pin screen.
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
index cba18cd..a74fb2e 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java
@@ -62,7 +62,12 @@ public class SlideShow {
     }
 
     public String getNotes(int aSlide) {
-        return mNotes.get(aSlide);
+        String aNote = mNotes.get(aSlide);
+        if (aNote != null) {
+            return aNote;
+        } else {
+            return "";
+        }
     }
 
     // ---------------------------------------------------- TIMER --------------


More information about the Libreoffice-commits mailing list