frontend: fix findbugs issue

Possible NPE - the vm can be null. Code which
expected it to be not null moved to the due if
statement.

Change-Id: I62b9e55f005b183ac4cdc642ebf5cfff4d125810
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>