]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
default security group name is undef when it does not exist (#81)
authorDylan Hardison <dylan@hardison.net>
Mon, 15 Mar 2021 14:30:01 +0000 (10:30 -0400)
committerGitHub <noreply@github.com>
Mon, 15 Mar 2021 14:30:01 +0000 (15:30 +0100)
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.

extensions/BMO/Extension.pm

index a63cd9996e8b9081ad546555c26b1b15af60ea03..d30d83317309946de2a74aca553e1a447c5dfcf9 100644 (file)
@@ -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 {