Fixed a possible NPE bug in PermanentView.