Deleting a ticket that has already been deleted crashes the server.

Open Beginner friendly
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript, node.js
Domain
api, backend

Research direction

Start in app/tickets/controller.js at line 78 and reproduce DELETE /tickets/ID after the ticket has already been removed. Trace the null result from the ticket lookup and verify that deleting a missing ticket no longer crashes the server. No test file is mentioned in the issue.

Written by the indexing model from the issue text.

Description

bug Good First Issue help wanted

calling DELETE /tickets/ID after the ticket has been removed crashes the server with the exception

    TypeError: Cannot read property '_id' of null
        at /var/www/kenthackenough/app/tickets/controller.js:78:22
        at Query.<anonymous> (/var/www/kenthackenough/node_modules/mongoose/lib/query.js:2120:28)
        at /var/www/kenthackenough/node_modules/mongoose/node_modules/kareem/index.js:177:19
        at /var/www/kenthackenough/node_modules/mongoose/node_modules/kareem/index.js:109:16
        at doNTCallback0 (node.js:407:9)
        at process._tickCallback (node.js:336:13)

Dominant language
JavaScript
Stars
6
Forks
11
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hacksu/kenthackenough

All issues in hacksu/kenthackenough

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.