Skip to content
Snippets Groups Projects
Commit 50c86ab9 authored by Robert Anderson's avatar Robert Anderson
Browse files

Check that we have attribute name, operator and value before adding

parent feceb028
No related branches found
No related tags found
No related merge requests found
...@@ -68,9 +68,18 @@ sub addAttribute ...@@ -68,9 +68,18 @@ sub addAttribute
{ {
my ($server,$nattributes,$vattributes,$attribute) = @_; my ($server,$nattributes,$vattributes,$attribute) = @_;
# Check we have the name, operator AND value
if (!defined($attribute->{'Name'}) || !defined($attribute->{'Operator'}) || !defined($attribute->{'Value'})) {
$server->log(LOG_DEBUG,"[ATTRIBUTES] Problem adding attribute with name = ".niceUndef($attribute->{'Name'}).
", operator = ".niceUndef($attribute->{'Operator'}).", value = ".niceUndef($attribute->{'Value'}));
return;
}
# Clean them up a bit # Clean them up a bit
$attribute->{'Name'} =~ s/\s*(\S+)\s*/$1/; $attribute->{'Name'} =~ s/\s*(\S+)\s*/$1/;
$attribute->{'Operator'} =~ s/\s*(\S+)\s*/$1/; $attribute->{'Operator'} =~ s/\s*(\S+)\s*/$1/;
# Grab attribue name, operator and value # Grab attribue name, operator and value
my $name = $attribute->{'Name'}; my $name = $attribute->{'Name'};
my $operator = $attribute->{'Operator'}; my $operator = $attribute->{'Operator'};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment