Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 59e908e

Browse files
author
Dragan
committed
CodeCoverage: Null reference fix, remove Debug ...
CodeCoverageMethodElement: Null reference thrown because Tests does not contain new attributes, fixed. Debug.Fail breaks Test, removed.
1 parent b64e0bb commit 59e908e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/AddIns/Analysis/CodeCoverage/Project/Src/CodeCoverageMethodElement.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ static CodeCoverageStringTextSource GetSource(string filename) {
133133
stream.Position = 0;
134134
string textSource = ICSharpCode.AvalonEdit.Utils.FileReader.ReadFileContent(stream, Encoding.Default);
135135
retSource = new CodeCoverageStringTextSource(textSource);
136-
} catch (Exception e) { Debug.Fail(e.Message); }
136+
} catch (Exception) {}
137137
}
138-
} catch (Exception e) { Debug.Fail(e.Message); }
138+
} catch (Exception) {}
139139

140140
cacheGetSource_LastFileName = filename;
141141
cacheGetSource_LastSource = retSource;
@@ -158,11 +158,11 @@ void GetSequencePoints() {
158158
sp.Offset = (int)GetDecimalAttributeValue(xSPoint.Attribute("offset"));
159159
sp.BranchExitsCount = (int)GetDecimalAttributeValue(xSPoint.Attribute("bec"));
160160
sp.BranchExitsVisit = (int)GetDecimalAttributeValue(xSPoint.Attribute("bev"));
161-
sp.FileID = xSPoint.Attribute("fileid").Value?? "0";
161+
sp.FileID = xSPoint.Attribute("fileid") != null? xSPoint.Attribute("fileid").Value : "0";
162162
if (sp.FileID == "0") {
163163
// SequencePoint from not covered (not runnable) file
164164
// ie: interface with CodeContractClass/CodeContractClassFor
165-
sp.Document = xSPoint.Attribute("fileid").Value?? "";
165+
sp.Document = xSPoint.Attribute("fileid") != null? xSPoint.Attribute("fileid").Value : "";
166166
}
167167
else if (sp.FileID == this.FileID) {
168168
// This method SequencePoint (from this.FileName)

0 commit comments

Comments
 (0)