Skip to content

Commit

Permalink
fix(api): v1 crash if ticket _id was incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Apr 12, 2019
1 parent fd20ff2 commit eea4d20
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/controllers/api/v1/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ apiTickets.update = function (req, res) {
var ticketModel = require('../../../models/ticket')
ticketModel.getTicketById(oId, function (err, ticket) {
if (err) return res.status(400).json({ success: false, error: err.message })
if (!ticket) return res.status(400).json({ success: false, error: 'Unable to locate ticket. Aborting...' })
async.parallel(
[
function (cb) {
Expand Down

0 comments on commit eea4d20

Please sign in to comment.