diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/model/Typesystem.cpp | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp index 4a2f4eb..561692a 100644 --- a/src/core/model/Typesystem.cpp +++ b/src/core/model/Typesystem.cpp @@ -344,7 +344,11 @@ Variant StructType::create() const  	Variant::arrayType arr;  	arr.resize(attributes.size());  	for (size_t idx = 0; idx < attributes.size(); idx++) { -		arr[idx] = attributes[idx]->getType()->create(); +		if (attributes[idx]->optional) { +			arr[idx] = attributes[idx]->defaultValue; +		} else { +			arr[idx] = attributes[idx]->getType()->create(); +		}  	}  	return arr;  }  | 
