Do not crash when trying to create bug with flags, but without selecting component

master
Vitaliy Filippov 2014-06-03 15:48:23 +04:00
parent 030b20f36b
commit eab080cfda
1 changed files with 2 additions and 1 deletions

View File

@ -1104,7 +1104,8 @@ sub _flag_types {
# Build custom userlist for setting flag
$cl = new Bugzilla::FlagType::UserList;
$cl->add('CC', @{$bug->cc_users || []});
$cl->add(CompQA => $_) for $bug->component_obj->default_qa_contact || ();
# component_obj can be NULL during creation of new bug
$cl->add(CompQA => $_) for $bug->component_obj && $bug->component_obj->default_qa_contact || ();
$cl->add(Reporter => $_) for $bug->reporter || ();
$cl->add(QA => $_) for $bug->qa_contact || ();
$cl->add(Assignee => $_) for $bug->assigned_to || ();