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

Commit eabd125

Browse files
committed
fix(copy): check for null object and src/dest
check for null oject and src/dst
1 parent 265f330 commit eabd125

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/copy.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ function getFilesPathsForConfig(copyConfigKeys: string[], copyConfig: CopyConfig
199199
const promises: Promise<GlobResult[]>[] = [];
200200
copyConfigKeys.forEach(key => {
201201
const copyOptions = copyConfig[key];
202-
const promise = globAll(copyOptions.src);
203-
promises.push(promise);
204-
promise.then(globResultList => {
205-
srcToResultsMap.set(key, globResultList);
206-
});
202+
if (copyOptions && copyOptions.src) {
203+
const promise = globAll(copyOptions.src);
204+
promises.push(promise);
205+
promise.then(globResultList => {
206+
srcToResultsMap.set(key, globResultList);
207+
});
208+
}
207209
});
208210

209211
return Promise.all(promises).then(() => {

0 commit comments

Comments
 (0)