Added safeguard for "new DirectoryInfo()" and "DirectoryInfo.GetFiles()" exceptions