From 7e99c6044b64ba5166c65b6e7702560ab5588c49 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 31 Mar 2014 15:41:18 +0200 Subject: fix #3708: NPE in database cleaning This happens only when the database is in bad shape, but prevents from seeing the error message. --- main/src/cgeo/geocaching/DataStore.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main/src/cgeo/geocaching/DataStore.java') diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java index 92517f2..a822b5d 100644 --- a/main/src/cgeo/geocaching/DataStore.java +++ b/main/src/cgeo/geocaching/DataStore.java @@ -2344,15 +2344,15 @@ public class DataStore { Log.d("Database clean: removing " + geocodes.size() + " geocaches from listId=0"); removeCaches(geocodes, LoadFlags.REMOVE_ALL); } + + // This cleanup needs to be kept in place for about one year so that older log images records are + // cleaned. TO BE REMOVED AFTER 2015-03-24. + Log.d("Database clean: removing obsolete log images records"); + database.delete(dbTableLogImages, "log_id NOT IN (SELECT _id FROM " + dbTableLogs + ")", null); } catch (final Exception e) { Log.w("DataStore.clean", e); } - // This cleanup needs to be kept in place for about one year so that older log images records are - // cleaned. TO BE REMOVED AFTER 2015-03-24. - Log.d("Database clean: removing obsolete log images records"); - database.delete(dbTableLogImages, "log_id NOT IN (SELECT _id FROM " + dbTableLogs + ")", null); - Log.d("Database clean: finished"); databaseCleaned = true; } -- cgit v1.1