diff --git a/init/init.c b/init/init.c
index a1d6be104a7e0a618a29c94a0837af9f31b09df1..ef42e025cc623684223c9a40cdd5813fe1aa83d0 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);