Skip to content
Permalink
Browse files

fix(accounts): crash if user had deleted tickets and was removed

  • Loading branch information...
polonel committed Mar 22, 2019
1 parent 40627d0 commit ce376b4cd8ce6b47ed79fc484d5b82ceb2323e11
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/controllers/api/v1/users.js
@@ -600,7 +600,7 @@ apiUsers.deleteUser = function (req, res) {
},
function (user, cb) {
var ticketSchema = require('../../../models/ticket')
ticketSchema.getTicketsByRequester(user._id, function (err, tickets) {
ticketSchema.find({ owner: user._id }, function (err, tickets) {
if (err) return cb(err)

var hasTickets = _.size(tickets) > 0

0 comments on commit ce376b4

Please sign in to comment.
You can’t perform that action at this time.