Skip to content

Commit

Permalink
fix(accounts): crash if user had deleted tickets and was removed
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Mar 22, 2019
1 parent 40627d0 commit ce376b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/api/v1/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce376b4

Please sign in to comment.