Skip to content

Commit

Permalink
Bug fix for property names that can be falsy
Browse files Browse the repository at this point in the history
Property names for map model objects can be anything, including numbers or null. Using a general falsification test might wrongly reject them.
  • Loading branch information
mike-lischke committed Dec 12, 2024
1 parent 39c6f19 commit fe39e1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/misc/MapModelAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class MapModelAdaptor<Key extends AllowedMapKey, Value> implements ModelA
public getProperty(_interp: IInterpreter, _self: IST, model: Map<Key, Value>, property: Key,
propertyName: string): ValueOrIterable<Key, Value> | undefined {
let value: ValueOrIterable<Key, Value> | undefined;
if (!property) {
if (property == null) {
value = MapModelAdaptor.getDefaultValue(model);
} else {
if (model.has(property)) {
Expand Down

0 comments on commit fe39e1c

Please sign in to comment.