Skip to content

Commit

Permalink
Update helpers.js
Browse files Browse the repository at this point in the history
Is there a problem here? Yes, there is. Please take a look at this error.

TypeError: Cannot read properties of undefined (reading 'indexOf')
    at Object.parseMask (/home/debian/node/client/server/libs/irc-framework-modded/src/helpers.js:20:23)
    at Array.RPL_TOPICWHOTIME (/home/debian/node/client/server/libs/irc-framework-modded/src/commands/handlers/channel.js:198:32)
    at IrcCommandHandler.executeCommand (/home/debian/node/client/server/libs/irc-framework-modded/src/commands/handler.js:65:40)
    at IrcCommandHandler.dispatch (/home/debian/node/client/server/libs/irc-framework-modded/src/commands/handler.js:52:18)
    at /home/debian/node/client/server/libs/irc-framework-modded/src/client.js:129:40
    at next (/home/debian/node/client/server/libs/irc-framework-modded/node_modules/middleware-handler/index.js:42:18)
    at MiddlewareHandler.handle (/home/debian/node/client/server/libs/irc-framework-modded/node_modules/middleware-handler/index.js:64:3)
    at Connection.<anonymous> (/home/debian/node/client/server/libs/irc-framework-modded/src/client.js:123:35)
    at Connection.emit (/home/debian/node/client/server/libs/irc-framework-modded/node_modules/eventemitter3/index.js:182:35)
    at Connection.addReadBuffer (/home/debian/node/client/server/libs/irc-framework-modded/src/connection.js:168:14)
  • Loading branch information
Madriix authored Dec 26, 2023
1 parent f2989ca commit f05f419
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ function parseMask(mask) {
let user = '';
let host = '';

const sep1 = mask.indexOf('!');
const sep2 = mask.indexOf('@');
//const sep1 = mask.indexOf('!');

Check failure on line 20 in src/helpers.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected space or tab after '//' in comment

Check failure on line 20 in src/helpers.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected space or tab after '//' in comment

Check failure on line 20 in src/helpers.js

View workflow job for this annotation

GitHub Actions / build (19.x)

Expected space or tab after '//' in comment
const sep1 = (mask || '').indexOf('!');
//const sep2 = mask.indexOf('@');

Check failure on line 22 in src/helpers.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Expected space or tab after '//' in comment

Check failure on line 22 in src/helpers.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Expected space or tab after '//' in comment

Check failure on line 22 in src/helpers.js

View workflow job for this annotation

GitHub Actions / build (19.x)

Expected space or tab after '//' in comment
const sep2 = (mask || '').indexOf('@');

if (sep1 === -1 && sep2 === -1) {
// something
Expand Down

0 comments on commit f05f419

Please sign in to comment.