Skip to content

Commit 7764097

Browse files
committed
prevent illegal state
1 parent b8ae5ab commit 7764097

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/com/flagsmith/mappers/EngineMappers.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ private static String getFeatureStateKey(JsonNode featureState) {
302302
if (node != null && !node.isNull()) {
303303
return node.asText();
304304
}
305-
// Feature state key is used in multivariate feature evaluation, not to
306-
// identify features uniquely, so if both fields are missing,
307-
// we don't need to care about collisions.
308-
return "";
305+
306+
throw new IllegalArgumentException(
307+
"Feature state must have either 'django_id' or 'featurestate_uuid'");
308+
}
309309

310310
private static double getMultivariateFeatureValuePriority(JsonNode multivariateValue) {
311311
JsonNode idNode = multivariateValue.get("id");

0 commit comments

Comments
 (0)