Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(copy): check for null object and src/dest
Browse files Browse the repository at this point in the history
check for null oject and src/dst
  • Loading branch information
danbucholtz committed Dec 22, 2016
1 parent 265f330 commit eabd125
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ function getFilesPathsForConfig(copyConfigKeys: string[], copyConfig: CopyConfig
const promises: Promise<GlobResult[]>[] = [];
copyConfigKeys.forEach(key => {
const copyOptions = copyConfig[key];
const promise = globAll(copyOptions.src);
promises.push(promise);
promise.then(globResultList => {
srcToResultsMap.set(key, globResultList);
});
if (copyOptions && copyOptions.src) {
const promise = globAll(copyOptions.src);
promises.push(promise);
promise.then(globResultList => {
srcToResultsMap.set(key, globResultList);
});
}
});

return Promise.all(promises).then(() => {
Expand Down

0 comments on commit eabd125

Please sign in to comment.