Fixed #21912 -- Improved error message if a view returns None.

Thanks brycenesbitt for the report.