Ensure $sources is Array before use
Merge pull request #1069 from radig/master

Ensure $sources is Array ( fix #3520 )