Closed
Description
/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.