core: Fix NPE when VM does not exists on register

Adding a null check if the VM sent in the parameters exists or not, to
prevent NPE.

Change-Id: I4fb846cc16d1d208f0b96a127169f717a3fec89e
Bug-Url: https://bugzilla.redhat.com/1148405
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>