Fix #1000 add a check on the directory handle and return an empty array.
Fix #1000 add a check on the directory handle and return an empty array.

leonardobarrientosc/SuiteCRM,JimMackin/SuiteCRM,KhyberPass/SuiteCRM,leonardobarrientosc/SuiteCRM,noelhunter/SuiteCRM,leonardobarrientosc/SuiteCRM,gcoop-libre/SuiteCRM,pgorod/SuiteCRM,gody01/SuiteCRM,JimMackin/SuiteCRM,pribeiro42/SuiteCRM,Dillon-Brown/SuiteCRM,recci/SuiteCRM,dfstrauss/SuiteCRM,ChangezKhan/SuiteCRM,digitalmcgrath/SuiteCRM,dfstrauss/SuiteCRM,lionixevolve/SuiteCRM,scottiems/crm-limai,lionixevolve/SuiteCRM,lionixevolve/LionixCRM,gcoop-libre/SuiteCRM,gody01/SuiteCRM,pgorod/SuiteCRM,KhyberPass/SuiteCRM,nadilhassan/SuiteCRM,krzyc/SuiteCRM,haris-raheem/SuiteCRM,daniel-samson/SuiteCRM,noelhunter/SuiteCRM,krzyc/SuiteCRM,KhyberPass/SuiteCRM,salesagility-davidthomson/SuiteCRM,JanSiero/SuiteCRM,adamjakab/SuiteCRM,salesagility/SuiteCRM,samus-aran/SuiteCRM,nadilhassan/SuiteCRM,salesagility-davidthomson/SuiteCRM,gymad/SuiteCRM,dfstrauss/SuiteCRM,horus68/SuiteCRM-Horus68,gymad/SuiteCRM,Dillon-Brown/SuiteCRM,samus-aran/SuiteCRM,pribeiro42/SuiteCRM,lionixevolve/LionixCRM,salesagility/SuiteCRM,shogunpol/SuiteCRM,JimMackin/SuiteCRM,noelhunter/SuiteCRM,Accendere/SuiteCRM,shogunpol/SuiteCRM,ChangezKhan/SuiteCRM,Accendere/SuiteCRM,horus68/SuiteCRM-Horus68,willrennie/SuiteCRM,recci/SuiteCRM,dfstrauss/SuiteCRM,horus68/SuiteCRM,scottiems/crm-limai,ryoon/SuiteCRM,horus68/SuiteCRM-Horus68,gunnicom/SuiteCRM,cumanacr/SuiteCRM,nadilhassan/SuiteCRM,JimMackin/SuiteCRM,gcoop-libre/SuiteCRM,gymad/SuiteCRM,gunnicom/SuiteCRM,noelhunter/SuiteCRM,JanSiero/SuiteCRM,pribeiro42/SuiteCRM,gunnicom/SuiteCRM,gcoop-libre/SuiteCRM,ryoon/SuiteCRM,root-smith/SuiteCRM,KhyberPass/SuiteCRM,ChangezKhan/SuiteCRM,Dillon-Brown/SuiteCRM,root-smith/SuiteCRM,horus68/SuiteCRM,root-smith/SuiteCRM,haris-raheem/SuiteCRM,willrennie/SuiteCRM,lionixevolve/SuiteCRM,scottiems/crm-limai,MikeyJC/SuiteCRM,leonardobarrientosc/SuiteCRM,willrennie/SuiteCRM,samus-aran/SuiteCRM,salesagility/SuiteCRM,pribeiro42/SuiteCRM,lionixevolve/LionixCRM,lionixevolve/LionixCRM,adamjakab/SuiteCRM,JanSiero/SuiteCRM,JanSiero/SuiteCRM,krzyc/SuiteCRM,cumanacr/SuiteCRM,pgorod/SuiteCRM,horus68/SuiteCRM,Accendere/SuiteCRM,lionixevolve/SuiteCRM,gymad/SuiteCRM,samus-aran/SuiteCRM,Accendere/SuiteCRM,ryoon/SuiteCRM,root-smith/SuiteCRM,lionixevolve/LionixCRM,willrennie/SuiteCRM,pgorod/SuiteCRM,nadilhassan/SuiteCRM,MikeyJC/SuiteCRM,scottiems/crm-limai,MikeyJC/SuiteCRM,ChangezKhan/SuiteCRM,shogunpol/SuiteCRM,daniel-samson/SuiteCRM,lionixevolve/LionixCRM,haris-raheem/SuiteCRM,adamjakab/SuiteCRM,cumanacr/SuiteCRM,haris-raheem/SuiteCRM,cumanacr/SuiteCRM,gunnicom/SuiteCRM,salesagility/SuiteCRM,shogunpol/SuiteCRM,Dillon-Brown/SuiteCRM,digitalmcgrath/SuiteCRM,MikeyJC/SuiteCRM,daniel-samson/SuiteCRM,gody01/SuiteCRM,recci/SuiteCRM,adamjakab/SuiteCRM,daniel-samson/SuiteCRM,recci/SuiteCRM,salesagility-davidthomson/SuiteCRM,krzyc/SuiteCRM,salesagility-davidthomson/SuiteCRM,horus68/SuiteCRM-Horus68,digitalmcgrath/SuiteCRM,gody01/SuiteCRM