Fix for #5579

If the view is named by a string try to look that up first.
I was suggesting that this block `if (data)` does not need to run unless `if (!viewClass)`, and could be moved inside that next check.