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

@@ -256,11 +256,11 @@ namespace DiscImageChef.Filters
string filenameNoExt = Path.GetFileNameWithoutExtension(path);
string parentFolder = Path.GetDirectoryName(path);
ProDosAppleDouble = Path.Combine(parentFolder, "R." + filename);
ProDosAppleDouble = Path.Combine(parentFolder ?? throw new InvalidOperationException(), "R." + filename);
UNIXAppleDouble = Path.Combine(parentFolder, "%" + filename);
DOSAppleDouble = Path.Combine(parentFolder, filenameNoExt + ".ADF");
DOSAppleDoubleLower = Path.Combine(parentFolder, filenameNoExt + ".adf");
NetatalkAppleDouble = Path.Combine(parentFolder, ".AppleDouble", filename);
NetatalkAppleDouble = Path.Combine(parentFolder, ".AppleDouble", filename ?? throw new InvalidOperationException());
DAVEAppleDouble = Path.Combine(parentFolder, "resource.frk", filename);
OSXAppleDouble = Path.Combine(parentFolder, "._" + filename);
UnArAppleDouble = Path.Combine(parentFolder, filename + ".rsrc");
@@ -426,11 +426,11 @@ namespace DiscImageChef.Filters
string filenameNoExt = Path.GetFileNameWithoutExtension(path);
string parentFolder = Path.GetDirectoryName(path);
ProDosAppleDouble = Path.Combine(parentFolder, "R." + filename);
ProDosAppleDouble = Path.Combine(parentFolder ?? throw new InvalidOperationException(), "R." + filename);
UNIXAppleDouble = Path.Combine(parentFolder, "%" + filename);
DOSAppleDouble = Path.Combine(parentFolder, filenameNoExt + ".ADF");
DOSAppleDoubleLower = Path.Combine(parentFolder, filenameNoExt + ".adf");
NetatalkAppleDouble = Path.Combine(parentFolder, ".AppleDouble", filename);
NetatalkAppleDouble = Path.Combine(parentFolder, ".AppleDouble", filename ?? throw new InvalidOperationException());
DAVEAppleDouble = Path.Combine(parentFolder, "resource.frk", filename);
OSXAppleDouble = Path.Combine(parentFolder, "._" + filename);
UnArAppleDouble = Path.Combine(parentFolder, filename + ".rsrc");

View File

@@ -200,7 +200,7 @@ namespace DiscImageChef.Filters
{
string parentFolder = Path.GetDirectoryName(path);
if(!File.Exists(Path.Combine(parentFolder, FinderInfo))) return false;
if(!File.Exists(Path.Combine(parentFolder ?? throw new InvalidOperationException(), FinderInfo))) return false;
if(!Directory.Exists(Path.Combine(parentFolder, Resources))) return false;
@@ -230,7 +230,7 @@ namespace DiscImageChef.Filters
if(baseFilename != macName && baseFilename != dosName && baseFilename != dosNameLow) continue;
dataFound |= File.Exists(Path.Combine(parentFolder, macName)) ||
dataFound |= File.Exists(Path.Combine(parentFolder, macName ?? throw new InvalidOperationException())) ||
File.Exists(Path.Combine(parentFolder, dosName)) ||
File.Exists(Path.Combine(parentFolder, dosNameLow));
@@ -266,7 +266,7 @@ namespace DiscImageChef.Filters
string baseFilename = Path.GetFileName(path);
FileStream finderDatStream =
new FileStream(Path.Combine(parentFolder, FinderInfo), FileMode.Open, FileAccess.Read);
new FileStream(Path.Combine(parentFolder ?? throw new InvalidOperationException(), FinderInfo), FileMode.Open, FileAccess.Read);
while(finderDatStream.Position + 0x5C <= finderDatStream.Length)
{
@@ -285,7 +285,7 @@ namespace DiscImageChef.Filters
if(baseFilename != macName && baseFilename != dosName && baseFilename != dosNameLow) continue;
if(File.Exists(Path.Combine(parentFolder, macName))) dataPath = Path.Combine(parentFolder, macName);
if(File.Exists(Path.Combine(parentFolder, macName ?? throw new InvalidOperationException()))) dataPath = Path.Combine(parentFolder, macName);
else if(File.Exists(Path.Combine(parentFolder, dosName)))
dataPath = Path.Combine(parentFolder, dosName);
else if(File.Exists(Path.Combine(parentFolder, dosNameLow)))
@@ -304,8 +304,8 @@ namespace DiscImageChef.Filters
break;
}
dataLen = new FileInfo(dataPath).Length;
rsrcLen = new FileInfo(rsrcPath).Length;
dataLen = new FileInfo(dataPath ?? throw new InvalidOperationException()).Length;
rsrcLen = new FileInfo(rsrcPath ?? throw new InvalidOperationException()).Length;
basePath = path;
opened = true;