#25: return true if file isn't empty, think if bool return value makes sense here

pull/27/head
Simon G 5 years ago
parent 1df5d49287
commit 225f10d1a0
  1. 3
      GBase/DataHandling/XmlDataWriter.cs

@ -31,7 +31,7 @@ namespace GBase.DataHandling
{
//if the xml file isn't empty, return
if (file.Length > 3) //> 3 because of BOM
return false;
return true; //TODO: Don't return bool?
XDocument xmlDocument = new XDocument();
xmlDocument.Add(new XElement(rootElementName));
@ -74,6 +74,7 @@ namespace GBase.DataHandling
if (typeName == null)
throw new ArgumentNullException(nameof(typeName));
file.Seek(0, SeekOrigin.Begin); //reset stream to it's beginning to be able to save it
XDocument xmlDocument = await XDocument.LoadAsync(file, LoadOptions.None, cancellationToken);
file.Seek(0, SeekOrigin.Begin); //reset stream to it's beginning to be able to save it

Loading…
Cancel
Save