Don't crash if we fail to load a view

Fixes #1709