catch up with development
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.xtext.entitymock.common/src/org/eclipse/osbp/xtext/entitymock/common/ABaseMockEntity.java b/org.eclipse.osbp.xtext.entitymock.common/src/org/eclipse/osbp/xtext/entitymock/common/ABaseMockEntity.java
index 67961a2..a18ec7c 100644
--- a/org.eclipse.osbp.xtext.entitymock.common/src/org/eclipse/osbp/xtext/entitymock/common/ABaseMockEntity.java
+++ b/org.eclipse.osbp.xtext.entitymock.common/src/org/eclipse/osbp/xtext/entitymock/common/ABaseMockEntity.java
@@ -169,7 +169,8 @@
}
// --- if up to 0% have to be optional, EVERYTHING is mandatory ---
else if (optionalFor <= 0.0) {
- getMockData().put(key, mockObjects[getFillerProvider().unsignedinteger(mockObjects.length-1)]);
+ if( mockObjects.length>0 )
+ getMockData().put(key, mockObjects[getFillerProvider().unsignedinteger(mockObjects.length-1)]);
}
// --- if a random is lower than the given optionalFor, this item is optional ---
else if (getFillerProvider().unsigneddouble(0) < optionalFor*100.0) {
@@ -177,7 +178,8 @@
}
// --- otherwise
else {
- getMockData().put(key, mockObjects[getFillerProvider().unsignedinteger(mockObjects.length-1)]);
+ if( mockObjects.length>0 )
+ getMockData().put(key, mockObjects[getFillerProvider().unsignedinteger(mockObjects.length-1)]);
}
}
}