aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2012-08-22 12:51:03 -0700
committerrsudev <rasch@munin-soft.de>2012-08-22 12:51:03 -0700
commit742d86e9eb096aba98c17d2a8d9d67a46e647105 (patch)
tree30c550b42c50edb08eca40fcd5f9806bdcd96275 /main/src
parent01011dff9ff9b88214f3caca1674b9079e51a595 (diff)
parent867e06e2cbfddf3a42fa2ff1c286e66eff2cd2f9 (diff)
downloadcgeo-742d86e9eb096aba98c17d2a8d9d67a46e647105.zip
cgeo-742d86e9eb096aba98c17d2a8d9d67a46e647105.tar.gz
cgeo-742d86e9eb096aba98c17d2a8d9d67a46e647105.tar.bz2
Merge pull request #1958 from marco-jacob/issue#1950
fixes #1950 - StaticMapsProvider checks input parameter for null
Diffstat (limited to 'main/src')
-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();