View: correctly validate input in PartialLoop

Change the condition to be more safe and intuitive.

Closes #4545
PartialLoop: rewrite input check even better
PartialLoop: simplify check, remove comment
PartialLoop: unit test for null values
Merge pull request #4546 from yogipw/hotfix/4545

View: correctly validate input in PartialLoop
[#4546] Updated test

- to use setExpectedException()
Merge branch 'hotfix/4546'

Close #4546
Fixes #4545