Add check for set state view, fix #1080.