Check if dir exists before glob()

I get an Invalid argument supplied for foreach() exception otherwise (on 1 system, other system works fine) (on develop this time)
Merge pull request #146 from barryvdh/patch-2

Check if dir exists before glob()