summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinit/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c
index a1d6be1..ef42e02 100755
--- a/init/init.c
+++ b/init/init.c
@@ -491,7 +491,7 @@ static struct command *get_first_command(struct action *act)
{
struct listnode *node;
node = list_head(&act->commands);
- if (!node)
+ if (!node || list_empty(&act->commands))
return NULL;
return node_to_item(node, struct command, clist);