Log error properly when no current state, and some other minor tweaks.

This commit is contained in:
nicm
2017-04-21 22:23:24 +00:00
parent 194a121ef6
commit c8ecbf38ab
3 changed files with 5 additions and 9 deletions

View File

@ -974,9 +974,8 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
fs->current = &current;
log_debug("%s: current is from client", __func__);
} else
return (-1);
if (!cmd_find_empty_state(fs->current) &&
!cmd_find_valid_state(fs->current))
goto error;
if (!cmd_find_valid_state(fs->current))
fatalx("invalid current find state");
/* An empty or NULL target is the current. */