From 09efdfb6039e023cce1df0fc036803df092fbacd Mon Sep 17 00:00:00 2001 From: rsudev Date: Sat, 24 Nov 2012 21:16:22 +0100 Subject: Fixes #2199 - Ensures 'not null' for trackable logs - Ensures loadLogs never returns null, only empty List<> - Three test-cases, surfacing the initial bug and the aspects of the fix --- main/src/cgeo/geocaching/cgData.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main/src/cgeo/geocaching/cgData.java') diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index 773f08a..b822c2b 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -1915,14 +1915,14 @@ public class cgData { } public List loadLogs(String geocode) { + List logs = new ArrayList(); + if (StringUtils.isBlank(geocode)) { - return null; + return logs; } init(); - List logs = new ArrayList(); - Cursor cursor = database.rawQuery( "SELECT cg_logs._id as cg_logs_id, type, author, log, date, found, friend, " + dbTableLogImages + "._id as cg_logImages_id, log_id, title, url FROM " + dbTableLogs + " LEFT OUTER JOIN " + dbTableLogImages -- cgit v1.1