summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-09-19 11:44:59 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2012-09-19 11:47:00 +0200
commitb1cd18bcd1d93c72c6ce84de42e58046bdaf8d1d (patch)
tree72bbd0d8052b9e779000b075c81bf2b5bc324ff4 /android
parent1ec2482f8e3693ec4d9335d3fb44af20bd77de49 (diff)
Return empty string for null notes to avoid showing null in UI.
Change-Id: I1f60ce48d9d11b074aa268eda118c427b3cc62c0
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java5
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/communication/SlideShow.java7
2 files changed, 11 insertions, 1 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java b/android/sdremote/src/org/libreoffice/impressremote/communication/NetworkClient.java
index 09bf16050770..ff49a537a567 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 cba18cd2d213..a74fb2eeed77 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 --------------