Sentinel [BUG] ParamFlowRuleManager的getRulesOfResource会有空指针异常

xvw2m8pv  于 2个月前  发布在  其他
关注(0)|答案(1)|浏览(22)
public static List<ParamFlowRule> getRulesOfResource(String resourceName) {
        return new ArrayList((Collection)PARAM_FLOW_RULES.get(resourceName));
    }

当PARAM_FLOW_RULES.get(resourceName)为null的时候, new ArrayList就会报空指针异常。
这个在对应的resourceName没有配置规则的时候,就会触发。

7y4bm7vi

7y4bm7vi1#

it seems that it will not cause npe here, because of the return of PARAM_FLOW_RULES.get(resourceName) will be empty list if not rule configured.

相关问题