Check if glob() returns some matches before continue, this should fix issue 1690
Merge pull request #1695 from owncloud/check_result_before_contionue

check results before continue