aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgData.java
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2012-11-24 21:16:22 +0100
committerrsudev <rasch@munin-soft.de>2012-11-24 21:16:22 +0100
commit09efdfb6039e023cce1df0fc036803df092fbacd (patch)
tree5d8420935417482879354f526193ef4ca10e1ee7 /main/src/cgeo/geocaching/cgData.java
parentb4b34451c6b42117524abb8e11dbdaae1355be57 (diff)
downloadcgeo-09efdfb6039e023cce1df0fc036803df092fbacd.zip
cgeo-09efdfb6039e023cce1df0fc036803df092fbacd.tar.gz
cgeo-09efdfb6039e023cce1df0fc036803df092fbacd.tar.bz2
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
Diffstat (limited to 'main/src/cgeo/geocaching/cgData.java')
-rw-r--r--main/src/cgeo/geocaching/cgData.java6
1 files changed, 3 insertions, 3 deletions
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<LogEntry> loadLogs(String geocode) {
+ List<LogEntry> logs = new ArrayList<LogEntry>();
+
if (StringUtils.isBlank(geocode)) {
- return null;
+ return logs;
}
init();
- List<LogEntry> logs = new ArrayList<LogEntry>();
-
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