aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo
diff options
context:
space:
mode:
authorMarco Jacob <mjacob@union06.de>2012-08-14 21:12:14 +0200
committerMarco Jacob <mjacob@union06.de>2012-08-14 21:12:14 +0200
commit867e06e2cbfddf3a42fa2ff1c286e66eff2cd2f9 (patch)
treeb9dd3a584c51704e26eca2dbdac217439aafcf0e /main/src/cgeo
parentd91935d5896dc62f8365f749505f8c039dee4e28 (diff)
downloadcgeo-867e06e2cbfddf3a42fa2ff1c286e66eff2cd2f9.zip
cgeo-867e06e2cbfddf3a42fa2ff1c286e66eff2cd2f9.tar.gz
cgeo-867e06e2cbfddf3a42fa2ff1c286e66eff2cd2f9.tar.bz2
fixes #1950 - StaticMapsProvider checks input parameter for null
Diffstat (limited to 'main/src/cgeo')
-rw-r--r--main/src/cgeo/geocaching/StaticMapsProvider.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/StaticMapsProvider.java b/main/src/cgeo/geocaching/StaticMapsProvider.java
index 6de1291..ea99d54 100644
--- a/main/src/cgeo/geocaching/StaticMapsProvider.java
+++ b/main/src/cgeo/geocaching/StaticMapsProvider.java
@@ -85,10 +85,13 @@ public class StaticMapsProvider {
}
private static void downloadMaps(cgCache cache, Display display) {
+ if (cache == null) {
+ Log.e("downloadMaps - missing input parameter cache");
+ return;
+ }
if ((!Settings.isStoreOfflineMaps() && !Settings.isStoreOfflineWpMaps()) || StringUtils.isBlank(cache.getGeocode())) {
return;
}
-
int edge = guessMaxDisplaySide(display);
if (Settings.isStoreOfflineMaps() && cache.getCoords() != null) {
@@ -112,6 +115,14 @@ public class StaticMapsProvider {
}
private static void storeWaypointStaticMap(final String geocode, int edge, cgWaypoint waypoint, final boolean waitForResult) {
+ if (geocode == null) {
+ Log.e("storeWaypointStaticMap - missing input parameter geocode");
+ return;
+ }
+ if (waypoint == null) {
+ Log.e("storeWaypointStaticMap - missing input parameter waypoint");
+ return;
+ }
if (waypoint.getCoords() == null) {
return;
}
@@ -142,6 +153,10 @@ public class StaticMapsProvider {
}
public static void storeCachePreviewMap(final cgCache cache) {
+ if (cache == null) {
+ Log.e("storeCachePreviewMap - missing input parameter cache");
+ return;
+ }
final String latlonMap = cache.getCoords().format(Format.LAT_LON_DECDEGREE_COMMA);
final String markerUrl = MARKERS_URL + "my_location_mdpi.png";
final Display display = ((WindowManager) cgeoapplication.getInstance().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();