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

Commit c12025f

Browse files
committed
Don't attempt to read a null error
1 parent 1496ffd commit c12025f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tasks/docs.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,18 @@ module.exports = function (grunt) {
3838
args: args,
3939
options: { cwd: process.cwd() }
4040
}, function (err, result) {
41-
var msg = err.toString();
42-
if (msg.indexOf("not found") !== -1 && msg.indexOf("psc-docs") !== -1) {
43-
return grunt.util.spawn({
44-
cmd: "docgen",
45-
args: args,
46-
options: { cwd: process.cwd() }
47-
}, function (err, result) {
48-
grunt.log.warn("Used deprecated 'docgen' executable rather than 'psc-docs'. Please update your PureScript compiler.");
49-
return handler(err, result);
50-
});
41+
if (err) {
42+
var msg = err.toString();
43+
if (msg.indexOf("not found") !== -1 && msg.indexOf("psc-docs") !== -1) {
44+
return grunt.util.spawn({
45+
cmd: "docgen",
46+
args: args,
47+
options: { cwd: process.cwd() }
48+
}, function (err, result) {
49+
grunt.log.warn("Used deprecated 'docgen' executable rather than 'psc-docs'. Please update your PureScript compiler.");
50+
return handler(err, result);
51+
});
52+
}
5153
}
5254
return handler(err, result);
5355
});

0 commit comments

Comments
 (0)