diff --git a/app/models/label.rb b/app/models/label.rb index 0298e7b417c7a761ace9070a61868a6e26bac246..958141a73587d99ec816c1dd0a7f65d6adb11c94 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -173,7 +173,7 @@ class Label < ActiveRecord::Base def as_json(options = {}) super(options).tap do |json| - json[:type] = self.type + json[:type] = self.try(:type) json[:priority] = priority(options[:project]) if options.key?(:project) end end