summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2010-12-26 15:38:59 +0100
committerLars-Dominik Braun <lars@6xq.net>2010-12-26 15:38:59 +0100
commitd074480b9159a53fc4e6bdb40463289c69c2f6a7 (patch)
tree65c4349d7d3b3c292acf51e41a5a566853a94af1
parent168fbd94f4f1ce710a80603db63478bda31c60f8 (diff)
downloadpianobar-d074480b9159a53fc4e6bdb40463289c69c2f6a7.tar.gz
pianobar-d074480b9159a53fc4e6bdb40463289c69c2f6a7.tar.bz2
pianobar-d074480b9159a53fc4e6bdb40463289c69c2f6a7.zip
Show message if no station is available
-rw-r--r--src/ui.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ui.c b/src/ui.c
index cef067d..3edccc7 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -302,6 +302,11 @@ PianoStation_t *BarUiSelectStation (PianoHandle_t *ph, const char *prompt,
size_t stationCount, i;
int input;
+ if (ph->stations == NULL) {
+ BarUiMsg (MSG_ERR, "No station available.\n");
+ return NULL;
+ }
+
/* sort and print stations */
sortedStations = BarSortedStations (ph->stations, &stationCount, order);
for (i = 0; i < stationCount; i++) {