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

Commit cea4dd8

Browse files
hayukidanbucholtz
authored andcommitted
fix(copy): fix null pointer in copy method error checking
A nullpointer exception was being thrown in copySrcToDest function when a copy error was detected and its message was interpreted.
1 parent a9227e0 commit cea4dd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/copy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function copySrcToDest(context: BuildContext, src: string, dest: string, filter:
143143

144144
fs.copy(src, dest, opts, (err) => {
145145
if (err) {
146-
if (err.message.indexOf('ENOENT') > -1) {
146+
if (err.message && err.message.indexOf('ENOENT') > -1) {
147147
resolve({ success: false, src: src, dest: dest, errorMessage: `Error copying "${src}" to "${dest}": File not found`});
148148
} else {
149149
resolve({ success: false, src: src, dest: dest, errorMessage: `Error copying "${src}" to "${dest}"`});

0 commit comments

Comments
 (0)