summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++) {