casbin / casbin-hub

The hub for Casbin
https://dashboard.casbin.com
Apache License 2.0
87 stars 46 forks source link

Unhandled Rejection (TypeError): enforcer is null #100

Closed arteevraina closed 4 years ago

arteevraina commented 4 years ago

When we want to add a new enforcer and click on the edit button. Error is displayed -

Unhandled Rejection (TypeError): enforcer is null
componentDidMount/<
src/EnforcerPage.js:47

  44 |        model: models.filter(model => model.id === enforcer.model)[0],
  45 |      });
  46 | 
> 47 |      this.getAdapterPolicies(enforcer.adapter);
     | ^  48 |      this.getAdapterGroupingPolicies(enforcer.adapter);
  49 |    });
  50 |  }

@hsluoyz Is this a valid one?

hsluoyz commented 4 years ago

Please fix it.

arteevraina commented 4 years ago

Please fix it.

Sure thing! Will make a PR for this soon.