Skip to content

TypeError: Cannot read property 'toString' of null #21

Description

@egyptianbman

return s.toString().replace(/[^a-zA-Z0-9.]+/g, '');

I'm creating this issue as a reminder for myself to look into this.

TypeError: Cannot read property 'toString' of null
    at getSafeString (node_modules/stratum-pool/lib/stratum.js:143:34)
    at getSafeWorkerString (node_modules/stratum-pool/lib/stratum.js:146:17)
    at handleAuthorize (node_modules/stratum-pool/lib/stratum.js:158:28)
    at handleMessage (node_modules/stratum-pool/lib/stratum.js:85:17)
    at messages.forEach.message (node_modules/stratum-pool/lib/stratum.js:291:25)
    at Array.forEach (<anonymous>)
    at Socket.socket.on.d (node_modules/stratum-pool/lib/stratum.js:273:26)

I couldn't ask for a better stack trace! Ok, it looks like someone was submitting requests to authenticate but the miner isn't sending any params through which leads message.params[0] being null. I'm tempted to create a PR that instabans any requests such as this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions