cgeo/c-geo-opensource — pull request #2031 by pilhuhn (2012-09-09 20:48:04+00:00)
Title: Prevent a NPE if cache and waypoint are null.

If a cache is shown e.g. from the "caches close by" functionality and then click on "Save static map", c:geo crashes with a NPE

09-09 22:29:34.032: ERROR/AndroidRuntime(8503): FATAL EXCEPTION: main
java.lang.NullPointerException
at cgeo.geocaching.apps.cache.navi.AbstractStaticMapsApp.invokeStaticMaps(AbstractStaticMapsApp.java:51)
at cgeo.geocaching.apps.cache.navi.DownloadStaticMapsApp.navigate(DownloadStaticMapsApp.java:27)
at cgeo.geocaching.apps.cache.navi.NavigationAppFactory$1.onClick(NavigationAppFactory.java:149)
at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:924)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1086)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2855)

Looking at the code, this can happen when cache and waypoint are null and thus the loggable. This patch should fix this.