Fixes issue #25 Extra null check

Fixes NullPointerException when executing list commands