Skip to content

Commit

Permalink
Protocol: add type check
Browse files Browse the repository at this point in the history
Fixes: #1059
  • Loading branch information
mscdex committed Aug 27, 2021
1 parent 4606d0e commit 918eb6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/protocol/Protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,9 @@ class Protocol {

const origSignal = name;

if (typeof origSignal !== 'string' || !origSignal)
throw new Error(`Invalid signal: ${origSignal}`);

let signal = name.toUpperCase();
if (signal.slice(0, 3) === 'SIG')
signal = signal.slice(3);
Expand Down

0 comments on commit 918eb6d

Please sign in to comment.