X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fmcollective%2Fmatcher.rb;fp=lib%2Fmcollective%2Fmatcher.rb;h=b4ea14167d8fd3906f6847d39f93518eac676d1f;hb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;hp=d374776eb968ffc3454c2c4ed183e5d4b6093dbe;hpb=8a3fe7daeecccf43dd71c59371c5005400d35101;p=packages%2Fprecise%2Fmcollective.git diff --git a/lib/mcollective/matcher.rb b/lib/mcollective/matcher.rb index d374776..b4ea141 100644 --- a/lib/mcollective/matcher.rb +++ b/lib/mcollective/matcher.rb @@ -96,7 +96,12 @@ module MCollective result = Data.send(function_hash["name"], function_hash["params"]) if function_hash["value"] - eval_result = result.send(function_hash["value"]) + begin + eval_result = result.send(function_hash["value"]) + rescue + # If data field has not been set we set the comparison result to nil + eval_result = nil + end return eval_result else return result @@ -130,6 +135,9 @@ module MCollective def self.eval_compound_fstatement(function_hash) l_compare = execute_function(function_hash) + # Break out early and return false if the function returns nil + return false unless l_compare + # Prevent unwanted discovery by limiting comparison operators # on Strings and Booleans if((l_compare.is_a?(String) || l_compare.is_a?(TrueClass) || l_compare.is_a?(FalseClass)) && function_hash["operator"].match(/<|>/))