Skip to content

Commit b25f63e

Browse files
ptolemybarnesagnivade
authored andcommitted
Prevents 'Cannot read property 'catch' of null' error when tldr is
invoked without arguments
1 parent 71f4b25 commit b25f63e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bin/tldr

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ if (program.list) {
112112
if (p === null) {
113113
program.outputHelp();
114114
process.exitCode = 1;
115+
} else {
116+
p.catch((err) => {
117+
console.error(err);
118+
process.exitCode = 1;
119+
});
115120
}
116-
p.catch((err) => {
117-
console.error(err);
118-
process.exitCode = 1;
119-
});

0 commit comments

Comments
 (0)