Skip to content

Got an error in submission #59

Closed
Closed
@fuermosi777

Description

@fuermosi777
/usr/local/lib/node_modules/leetcode-cli/lib/commands/submit.js:60
          if (!submission.distributionChart) return;
                         ^

TypeError: Cannot read property 'distributionChart' of undefined
    at /usr/local/lib/node_modules/leetcode-cli/lib/commands/submit.js:60:26
    at /usr/local/lib/node_modules/leetcode-cli/lib/leetcode_client.js:201:19

It happens occasionally. I think the reason is that the leetcode_client.js getSubmission() call is not successful, and the callback function doesn't handle the error correctly: https://github.com/skygragon/leetcode-cli/blob/master/lib/commands/submit.js#L60

Perhaps adding a if (e) {} check to throw it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions