Skip to content

Commit

Permalink
chore(defaults): check for invalid type
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jan 30, 2019
1 parent 8ff63ba commit 07dc50b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/settings/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function ticketTypeSettingDefault (callback) {

var type = _.first(types)
if (!type) return callback('No Types Defined!')
if (!_.isPlainObject(type) || !_.has(type, '_id')) return callback('Invalid Type. Skipping.')
if (!_.isObject(type) || _.isUndefined(type._id)) return callback('Invalid Type. Skipping.')

// Save default ticket type
var defaultTicketType = new SettingsSchema({
Expand Down

0 comments on commit 07dc50b

Please sign in to comment.