Compare View
Commits (2)
Changes
Showing 2 changed files Side-by-side Diff
package.json
rc-from-msg.js
... | ... | @@ -7,9 +7,18 @@ function logOnDebug(msg) { |
7 | 7 | } |
8 | 8 | |
9 | 9 | function run(msg, rules) { |
10 | - if (typeof msg !== 'string') return; | |
11 | - if (!rules) return; | |
12 | - if (!rules.length) return; | |
10 | + if (typeof msg !== 'string') { | |
11 | + logOnDebug('RC-FROM-MSG: invalid msg'); | |
12 | + return; | |
13 | + } | |
14 | + if (!rules) { | |
15 | + logOnDebug('RC-FROM-MSG: invalid rules'); | |
16 | + return; | |
17 | + } | |
18 | + if (!rules.length) { | |
19 | + logOnDebug('RC-FROM-MSG: rules is empty'); | |
20 | + return; | |
21 | + } | |
13 | 22 | |
14 | 23 | const rules_count = rules.length; |
15 | 24 | for(let i = 0; i < rules_count; i++) { |