Just a note for the future: please also include the bug number in the commit title, so it can also be seen in one-line git history. From the developer documentation [0]: If the commit fixes a bug start with that information in this form: fix #1234: summary here
[0]: https://pve.proxmox.com/wiki/Developer_Documentation#Commits_and_Commit_Messages Am 11.03.26 um 1:50 PM schrieb Daniel Kral: > If the rule is not defined or does not have a type set, there are no > optional property defaults to set. > > This prevents users of set_rule_defaults(...) to have to deal with > unnecessary error handling. > > Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7399 > Signed-off-by: Daniel Kral <[email protected]> > --- > src/PVE/HA/Rules.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/HA/Rules.pm b/src/PVE/HA/Rules.pm > index 38c57548..3a14eeb3 100644 > --- a/src/PVE/HA/Rules.pm > +++ b/src/PVE/HA/Rules.pm > @@ -274,7 +274,8 @@ haven't been explicitly set yet. > sub set_rule_defaults { > my ($class, $rule) = @_; > > - if (my $plugin = $class->lookup($rule->{type})) { > + if ($rule && $rule->{type}) { > + my $plugin = $class->lookup($rule->{type}); > my $properties = $plugin->properties(); > > for my $prop (keys %$properties) {
