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
java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "growthbook.sdk.java.ParentCondition.getGate()" is null
#117
Closed
aalenkin-uzum opened this issue
Feb 4, 2025
· 3 comments
I created a holdout feature and experiment according to the documentation and tied them to a business feature.
Field "gate" of ParentCondition block marked as optional in documentation.
I receive this json configuration from GrowthBook:
With this json-configuration im getting exception from SDK:
ERROR 69022 --- [ main] growthbook.sdk.java.FeatureEvaluator : Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "growthbook.sdk.java.ParentCondition.getGate()" is null
java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "growthbook.sdk.java.ParentCondition.getGate()" is null
at growthbook.sdk.java.FeatureEvaluator.evaluateFeature(FeatureEvaluator.java:191) ~[growthbook-sdk-java-0.9.91.jar:na]
at growthbook.sdk.java.GrowthBook.evalFeature(GrowthBook.java:80) ~[growthbook-sdk-java-0.9.91.jar:na]
I think this is because the field is marked as optional, but there is an explicit call to parentCondition.getGate() in the code, that causes the NPE:
It looks like this is being reproduced specifically for users who were included in the holdout
Please tell me what is causing the error - a bug in the SDK, incorrect experiment holdout configuration, or something else?
The text was updated successfully, but these errors were encountered:
Hi @aalenkin-uzum. We have checked this issue, and yes, it is a bug in the SDK. The problem arises from incorrect handling of the optional gate field in the ParentCondition object. We have fixed this issue in the following PR, and the problem with the gate variable has been addressed in this commit. Thank you for your patience!
Hello!
I'm using Java SDK version 0.9.91.
I created a holdout feature and experiment according to the documentation and tied them to a business feature.
Field "gate" of ParentCondition block marked as optional in documentation.
I receive this json configuration from GrowthBook:
parentConditions block has no field "gate" here and I don't know how to put it there.
With this json-configuration im getting exception from SDK:
I think this is because the field is marked as optional, but there is an explicit call to parentCondition.getGate() in the code, that causes the NPE:
It looks like this is being reproduced specifically for users who were included in the holdout
Please tell me what is causing the error - a bug in the SDK, incorrect experiment holdout configuration, or something else?
The text was updated successfully, but these errors were encountered: