#557 NoMethodError: undefined method '[]' for nil:NilClass

This commit is contained in:
Karel.Picman 2022-02-09 12:53:55 +01:00
parent f6d696cf0e
commit 7f8a27d1d7
3 changed files with 5 additions and 3 deletions

View File

@ -87,11 +87,11 @@ class DmsfFile < ActiveRecord::Base
end end
def initialize(*args) def initialize(*args)
super
@project = nil @project = nil
if new_record? if new_record?
self.watcher_user_ids = [] self.watcher_user_ids = []
end end
super
end end
def self.storage_path def self.storage_path

View File

@ -122,10 +122,10 @@ class DmsfFolder < ActiveRecord::Base
end end
def initialize(*args) def initialize(*args)
super
if new_record? if new_record?
self.watcher_user_ids = [] self.watcher_user_ids = []
end end
super
end end
def default_values def default_values

View File

@ -30,8 +30,10 @@ module RedmineDmsf
# Overridden methods # Overridden methods
def initialize(attributes=nil, *args) def initialize(attributes=nil, *args)
self.watcher_user_ids = []
super super
if new_record?
self.watcher_user_ids = []
end
end end
def copy(project, options={}) def copy(project, options={})