From eab080cfda1f1cf3554104f20a680dca3d43c958 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 3 Jun 2014 15:48:23 +0400 Subject: [PATCH] Do not crash when trying to create bug with flags, but without selecting component --- Bugzilla/Flag.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index eb566e745..fcbf68ed1 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -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 || ();