init: check for list empty when getting commands for action

Change-Id: Id42d6a6b6297919b2e6520e074e31b5e01ae17bc
Signed-off-by: Dima Zavin <dima@android.com>
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 @@
 {
     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);