Mercurial > projects > orange
changeset 19:8ab9588b92bf
getValueOfAtrribute has no return at end of method. Fixes #5.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 14 Aug 2010 17:24:42 +0200 |
parents | 3d42ea434d46 |
children | 963b756ed579 |
files | orange/serialization/archives/XMLArchive.d |
diffstat | 1 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/orange/serialization/archives/XMLArchive.d Thu Aug 12 23:24:51 2010 +0200 +++ b/orange/serialization/archives/XMLArchive.d Sat Aug 14 17:24:42 2010 +0200 @@ -360,8 +360,15 @@ lastElement = tmp; auto runtimeType = getValueOfAttribute(Attributes.runtimeTypeAttribute); + + if (!runtimeType) + return T.init; + auto name = fromDataType!(string)(runtimeType); id = getValueOfAttribute(Attributes.idAttribute); + + if (!id) + return T.init; T result; @@ -410,6 +417,10 @@ lastElement = element; auto length = getValueOfAttribute(Attributes.lengthAttribute); + + if (!length) + return T.init; + value.length = fromDataType!(size_t)(length); return value; @@ -442,6 +453,9 @@ lastElement = element; id = getValueOfAttribute(Attributes.idAttribute); + + if (!id) + return T.init; T result = new BaseTypeOfPointer!(T); @@ -570,7 +584,9 @@ else errorCallback(new ArchiveException(`Could not unarchive the value of the attribute "` ~ to!(string)(attribute) ~ `" due to malformed data.`, __FILE__, __LINE__), [attribute]); } - } + } + + return null; } private void addArchivedReference (T) (T value, DataType id)