Guard in case opt is empty

Signed-off-by: abbr <wenfred@gmail.com>