From: Dylan Hardison Date: Mon, 15 Mar 2021 14:30:01 +0000 (-0400) Subject: default security group name is undef when it does not exist (#81) X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=230465d16e86c91be034d2acaeefd92c07802184;p=thirdparty%2Fbugzilla.git default security group name is undef when it does not exist (#81) The BMO extension provides a default security group to products. I think this is a good feature that should be core'd. In the meantime, there is no default security group for the initial data set, so this makes it so that when there isn't one, when the name is looked up it isn't an error. --- diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index a63cd9996..d30d83317 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -2481,7 +2481,9 @@ sub _group_always_settable { } sub _default_security_group { - return $_[0]->default_security_group_obj->name; + my $security_group = $_[0]->default_security_group_obj; + + return defined($security_group) ? $security_group->name : undef; } sub _default_security_group_obj {