From 230465d16e86c91be034d2acaeefd92c07802184 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Mon, 15 Mar 2021 10:30:01 -0400 Subject: [PATCH] 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. --- extensions/BMO/Extension.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.47.3