changeset 22:963b756ed579

Resolved merge conflicts.
author Jacob Carlborg <doob@me.com>
date Mon, 04 Oct 2010 20:42:45 +0200
parents 8ab9588b92bf (diff) 51f05fd6a626 (current diff)
children 947c32ec0ea7
files orange/serialization/archives/XMLArchive.d
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/orange/serialization/archives/XMLArchive.d	Mon Oct 04 20:18:02 2010 +0200
+++ b/orange/serialization/archives/XMLArchive.d	Mon Oct 04 20:42:45 2010 +0200
@@ -418,14 +418,14 @@
 		auto runtimeType = getValueOfAttribute(Attributes.runtimeTypeAttribute);
 		
 		if (!runtimeType)
-			return T.init;			
+			return T.init;	
 		
 		auto name = fromDataType!(string)(runtimeType);
 		id = getValueOfAttribute(Attributes.idAttribute);
 		
 		if (!id)
 			return T.init;
-		
+				
 		T result = cast(T) newInstance(name);
 		
 		addUnarchivedReference(result, id);
@@ -458,6 +458,9 @@
 		auto value = fromDataType!(T)(element.value);
 		slice.id = getValueOfAttribute(Attributes.idAttribute, element);
 		
+		if (!slice.id)
+			return T.init;
+		
 		addUnarchivedSlice(value, slice.id);
 		
 		return value;
@@ -658,7 +661,7 @@
 					errorCallback(new ArchiveException(`Could not unarchive the value of the attribute "` ~ to!(string)(attribute) ~ `" due to malformed data.`, __FILE__, __LINE__), [attribute]);
 			}
 		}
-		
+
 		return null;
 	}