Skip to content

NPE when update ParamFlowRule before the resource has been requested once #1895

@MrCoderYu

Description

@MrCoderYu

Type: bug report

Describe what happened (or what feature you want)

when update ParamFlowRule with ParamFlowRuleManager.loadRules()
if one of the resource has not bean requested before(there is no metric found),then NPE occurs
the code is here:[ParameterMetricStorage.getParamMetricForResource(resource).clearForRule(rule);]

Describe what you expected to happen

judge if the metric is null or not...

How to reproduce it (as minimally and precisely as possible)

  1. init a api resource with ParamRuleManager
  2. update that before that has been requested

Tell us your environment

1.8.0

Anything else we need to know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/hotspot-param-flowIssues or PRs related to "hot-spot" param flow controlgood first issueGood for newcomerskind/bugCategory issues or prs related to bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions