diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-03-31 15:41:18 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-03-31 15:41:18 +0200 |
| commit | 7e99c6044b64ba5166c65b6e7702560ab5588c49 (patch) | |
| tree | 314629ac5378adbed144d0270efa1fefe284ee6e /main/src | |
| parent | 46675dfdcb4c7b511b4c35e4a2242e47d4678fd4 (diff) | |
| download | cgeo-7e99c6044b64ba5166c65b6e7702560ab5588c49.zip cgeo-7e99c6044b64ba5166c65b6e7702560ab5588c49.tar.gz cgeo-7e99c6044b64ba5166c65b6e7702560ab5588c49.tar.bz2 | |
fix #3708: NPE in database cleaning
This happens only when the database is in bad shape, but prevents from
seeing the error message.
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/DataStore.java | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |
