@@ -106,12 +106,15 @@ private static boolean doesRuleMatch(Rule rule) {
106106 private static boolean matchOperator (String value , String operator , List <String > matches ) {
107107 // not sure if these are nullable, but the semantics make sense
108108 // and that will save us from a NPE
109- if (value == null || matches == null || operator == null ) {
109+ if (value == null || operator == null ) {
110110 return false ;
111111 }
112112 if (operator == "exists" ) {
113113 return true ;
114114 }
115+ if (matches == null ) {
116+ return false ;
117+ }
115118 value = value .toLowerCase ();
116119 for (String match : matches ) {
117120 if (match == null ) {
@@ -148,11 +151,11 @@ static boolean selectorMatch(String origin, List<String> matches, String operato
148151 if (key == null ) {
149152 return false ;
150153 }
151- String value = System .getenv (key .toUpperCase ());
152- if (value == null ) {
154+ String envValue = System .getenv (key .toUpperCase ());
155+ if (envValue == null ) {
153156 return false ;
154157 }
155- return matchOperator (value , operator , matches );
158+ return matchOperator (envValue , operator , matches );
156159 case "process_arguments" :
157160 if (key == null ) {
158161 return false ;
@@ -164,8 +167,8 @@ static boolean selectorMatch(String origin, List<String> matches, String operato
164167 key );
165168 return false ;
166169 }
167- value = System .getProperty (key .substring (2 ));
168- return matchOperator (value , operator , matches );
170+ String argValue = System .getProperty (key .substring (2 ));
171+ return matchOperator (argValue , operator , matches );
169172 case "tags" :
170173 // TODO: Support this down the line (Must define the source of "tags" first)
171174 return false ;
0 commit comments