Add null check.
Add null check.

The view model may not be a clone view model immediately (if a login is required, it will be a login view model first). We were already doing an `as` but forgot to allow for the result to be null. Fixes #1075.

github/VisualStudio,github/VisualStudio,github/VisualStudio