charlespwd / habitica-cli

An immersive command line interface for Habitica :zap::fire:
36 stars 4 forks source link

Error in terminal when running Habitica CLI #20

Open vjxyz opened 3 years ago

vjxyz commented 3 years ago

Terminal throws this error after entering habitica into terminal:

habitica $ (node:35840) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'text' of undefined
    at toQuestDetails (/usr/local/lib/node_modules/habitica-cli/lib/user.js:210:25)
    at Object._callee3$ (/usr/local/lib/node_modules/habitica-cli/lib/user.js:75:34)
    at tryCatch (/usr/local/lib/node_modules/habitica-cli/node_modules/regenerator-runtime/runtime.js:65:40)
    at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/habitica-cli/node_modules/regenerator-runtime/runtime.js:303:22)
    at Generator.prototype.<computed> [as next] (/usr/local/lib/node_modules/habitica-cli/node_modules/regenerator-runtime/runtime.js:117:21)
    at step (/usr/local/lib/node_modules/habitica-cli/lib/user.js:136:191)
    at /usr/local/lib/node_modules/habitica-cli/lib/user.js:136:361
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:35840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:35840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

After a Ctrl+C, program still appears to work, however.

charlespwd commented 3 years ago

Looks like the quest details aren't found in habitica-cli/lib/user.js:210:25.

Might be safe to put a || {} for the questDetails. PRs are welcome :) I'm using this anymore so can't test or debug.