You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Currently role_definition is an optional section in the model definitions and the role assertions (model["g"]) won't be initialized if it is omited. However, the other parts of the code won't check if it is initialized before use and result in an nil pointer panic (e.g. some lines directly read model["g"]["g"] or even more without check). This affects a wide range of public and private functions.
To Reproduce
Steps to reproduce the behavior:
Initialize the model with no role_definition section
Call a function that related to role
Some of them may return, most of them will panic
Expected behavior
The panic should not be happen. Involve nil checks to return an error rather than panic.
Additional context
According to the documentation, this is a misuse. Following the guidelines would not encounter this issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently
role_definition
is an optional section in the model definitions and the role assertions (model["g"]
) won't be initialized if it is omited. However, the other parts of the code won't check if it is initialized before use and result in an nil pointer panic (e.g. some lines directly readmodel["g"]["g"]
or even more without check). This affects a wide range of public and private functions.To Reproduce
Steps to reproduce the behavior:
role_definition
sectionExpected behavior
The panic should not be happen. Involve nil checks to return an error rather than panic.
Additional context
According to the documentation, this is a misuse. Following the guidelines would not encounter this issue.
The text was updated successfully, but these errors were encountered: