summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctl-lib/ctl-action.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c
index ce9b2b8..e7c3361 100644
--- a/ctl-lib/ctl-action.c
+++ b/ctl-lib/ctl-action.c
@@ -27,9 +27,12 @@
#include "ctl-config.h"
int ActionLabelToIndex(CtlActionT*actions, const char* actionLabel) {
- for (int idx = 0; actions[idx].uid; idx++) {
- if (!strcasecmp(actionLabel, actions[idx].uid)) return idx;
+ if (actions) {
+ for (int idx = 0; actions[idx].uid; idx++) {
+ if (!strcasecmp(actionLabel, actions[idx].uid)) return idx;
+ }
}
+
return -1;
}