Fixes #3471, NPE when leaving cache details

Check for not stored view state on restoring