Skip to content

Test is broken due to NullException #5

@naxxfish

Description

@naxxfish
    this.username = user.username;
                         ^

TypeError: Cannot read property 'username' of null
    at new wmic (E:\dev\ohwm2graphite\ohwm2graphite\node_modules\wmi-client\lib\wmic.js:20:26)
    at Object.<anonymous> (E:\dev\ohwm2graphite\ohwm2graphite\node_modules\wmi-client\test\index.js:5:11)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! Test failed.  See above for more details.

The getUsername function returns null if it's provided with an empty string or null, therefore the test script (which passes username: null in it's options) gets null back, and therefore a call to user.username in wmic.js subsequently fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions