Skip to content

Commit

Permalink
fix(tickettype): crash when deleting ticket type #113
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Nov 28, 2018
1 parent 16df8d2 commit dc4d335
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controllers/api/v1/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,9 @@ apiTickets.deleteType = function(req, res) {
function(next) {
settingsSchema.getSettingByName('mailer:check:ticketype', function(err, setting) {
if (err) return next(err);
if (setting.value.toString().toLowerCase() === delTypeId.toString().toLowerCase())
if (setting && setting.value.toString().toLowerCase() === delTypeId.toString().toLowerCase())
return next({custom: true, message: 'Type currently "Default Ticket Type" for mailer check.'});

return next(null);
});
},
Expand Down

0 comments on commit dc4d335

Please sign in to comment.