From be108389c5f5972380b4b3032f77f836bb83accc Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 25 Apr 2017 11:01:33 +0100 Subject: [PATCH] Journal viewer: verify journal entry content is not null before searching it. This actually happened for a user, which is weird, because entries should never be null, but I guess it is a possible scenario. --- .../syncadapter/ui/journalviewer/ListEntriesFragment.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java b/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java index 87feec28..515840fa 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/journalviewer/ListEntriesFragment.java @@ -92,6 +92,10 @@ public class ListEntriesFragment extends ListFragment implements AdapterView.OnI } private String getLine(String content, String prefix) { + if (content == null) { + return null; + } + int start = content.indexOf(prefix); if (start >= 0) { int end = content.indexOf("\n", start);