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

@@ -274,7 +274,7 @@ namespace DiscImageChef.DiscImages
{
line = tocStream.ReadLine();
dm = dr.Match(line);
dm = dr.Match(line ?? throw new InvalidOperationException());
cm = cr.Match(line);
// Skip comments at start of file
@@ -390,7 +390,7 @@ namespace DiscImageChef.DiscImages
line++;
_line = tocStream.ReadLine();
matchDiskType = regexDiskType.Match(_line);
matchDiskType = regexDiskType.Match(_line ?? throw new InvalidOperationException());
matchComment = regexComment.Match(_line);
// Skip comments at start of file
@@ -416,7 +416,7 @@ namespace DiscImageChef.DiscImages
line++;
_line = tocStream.ReadLine();
matchComment = regexComment.Match(_line);
matchComment = regexComment.Match(_line ?? throw new ());
matchDiskType = regexDiskType.Match(_line);
matchMcn = regexMcn.Match(_line);
matchTrack = regexTrack.Match(_line);

View File

@@ -351,7 +351,7 @@ namespace DiscImageChef.DiscImages
Match tm;
// First line must be SESSION, REM, CATALOG, FILE or CDTEXTFILE.
sm = sr.Match(_line);
sm = sr.Match(_line ?? throw new InvalidOperationException());
rm = rr.Match(_line);
cm = cr.Match(_line);
fm = fr.Match(_line);

View File

@@ -153,7 +153,7 @@ namespace DiscImageChef.DiscImages
Match hdm;
hdm = hdr.Match(_line);
hdm = hdr.Match(_line ?? throw new InvalidOperationException());
return hdm.Success;
}

View File

@@ -167,7 +167,7 @@ namespace DiscImageChef.DiscImages
{
Regex regexTrack = new Regex(TRACK_REGEX);
Match trackMatch = regexTrack.Match(_line);
Match trackMatch = regexTrack.Match(_line ?? throw new InvalidOperationException());
if(!trackMatch.Success) return false;
@@ -231,7 +231,7 @@ namespace DiscImageChef.DiscImages
}
else
{
trackMatch = regexTrack.Match(_line);
trackMatch = regexTrack.Match(_line ?? throw new InvalidOperationException());
if(!trackMatch.Success)
throw new ImageNotSupportedException(string.Format("Unknown line \"{0}\" at line {1}",