Currently, a NullReferenceException is thrown because of the incorrect structure.
As a workaround the exception can be handled using the Handling Exceptions mechanism.