fix #3477: NPE in view state management