Fix for #5579

If the view is named by a string try to look that up first.
Not sure witch `if` you are referring to? these checks do need to happen before the `normalizePath`