REFACTOR: Possible 'null' assignment to entity marked with 'NotNull' attribute.

This commit is contained in:
2017-12-21 14:41:38 +00:00
parent dcd053b20d
commit 9883b567ff
15 changed files with 34 additions and 33 deletions

View File

@@ -74,10 +74,10 @@ namespace DiscImageChef.Server.Controllers
Random rng = new Random();
string filename = string.Format("NewReport_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next());
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Upload", filename))) filename = string.Format("NewReport_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next());
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Upload", filename))) filename = string.Format("NewReport_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next());
FileStream newFile =
new FileStream(Path.Combine(HostingEnvironment.MapPath("~"), "Upload", filename),
new FileStream(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Upload", filename),
FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None);
xs.Serialize(newFile, newReport);
newFile.Close();