Removed unnecessary null-check in restoreState()