--- android/TrainInfo/src/dk/thoerup/traininfo/ShortcutActivity.java 2010/10/01 17:33:30 1150 +++ android/TrainInfo/src/dk/thoerup/traininfo/ShortcutActivity.java 2010/10/01 17:47:49 1151 @@ -8,6 +8,7 @@ import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; +import android.widget.Toast; import dk.thoerup.android.traininfo.common.StationBean.StationEntry; import dk.thoerup.traininfo.WelcomeScreen.ListType; @@ -64,11 +65,16 @@ } else { //launched by the user clicking on the shortcut String stationStr = intent.getStringExtra("station"); - StationEntry station = StationEntry.fromCSV(stationStr); + + if (stationStr != null) { //haven't reproduced it, but got a stacktrace where stationStr apparently was null + StationEntry station = StationEntry.fromCSV(stationStr); - Intent launcher = new Intent( this, DepartureList.class ); - launcher.putExtra("stationbean", station); - startActivityForResult(launcher, SHOW_DEPARTURES); + Intent launcher = new Intent( this, DepartureList.class ); + launcher.putExtra("stationbean", station); + startActivityForResult(launcher, SHOW_DEPARTURES); + } else { + Toast.makeText(this, "Invalid TrainInfo shortcut - please delete and re-create", Toast.LENGTH_LONG).show(); + } } }