Prevent NullReferenceException in case of missing Host

Do not throw a NullReferenceException when Host variable is not set.
Ignore the calls to RegisterObject and UnregisterObject instead.
Merge pull request #1333 from joero74/ignore-missing-host

Prevent NullReferenceException in case of missing Host