Add check for set state view, fix #1080.
Merge pull request #1082 from normanjaeckel/SetStateView

Add check for set state view, fix #1080.