Move  check so the variable will never be undefined
Merge pull request #4218 from owncloud/newdata

Fix potential undefined variable in Scanner