Skip to content

Commit 054198b

Browse files
author
Open Lowcode SAS
committed
Close #245
1 parent c33ad94 commit 054198b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/org/openlowcode/server/data/properties/Typed.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void postprocStoredobjectInsert(E object) {
6666
// creates the companion object.
6767
ChoiceValue<F> value = typeddefinition.getTypeChoice().parseChoiceValue(type.getPayload());
6868
CompanionInterface<?, E, F> blankcompanion = typeddefinition.getHelper().generateBlankCompanion(value);
69-
blankcompanion.insertcompanion(object);
69+
if (blankcompanion!=null) blankcompanion.insertcompanion(object);
7070
}
7171

7272
/**

src/org/openlowcode/server/data/properties/typed/TypedHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public TypedHelper() {
3737
public CompanionInterface<?,E,F> generateBlankCompanion(ChoiceValue<F> type) {
3838
if (type==null) throw new RuntimeException("Provided choice is null");
3939
Supplier<CompanionInterface<?,E,F>> supplier = suppliersbytype.get(type);
40-
if (supplier==null) throw new RuntimeException("No supplier found for type "+type.getDisplayValue());
40+
// typed should work if for some types, companion is not present
41+
if (supplier==null) return null;
4142
return supplier.get();
4243
}
4344

0 commit comments

Comments
 (0)