Skip to content

Commit 849908c

Browse files
committed
Fix NPE
1 parent e87ab91 commit 849908c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/surefire/data/SurefireStaxHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ private static UnitTestResult parseTestResult(SMInputCursor testCaseCursor) thro
121121

122122
private static long getTimeAttributeInMS(String value) throws XMLStreamException {
123123
// hardcoded to Locale.ENGLISH see http://jira.codehaus.org/browse/SONAR-602
124+
if (value == null) {
125+
return 0L;
126+
}
124127
try {
125128
Double time = ParsingUtils.parseNumber(value, Locale.ENGLISH);
126129
return !Double.isNaN(time) ? (long) ParsingUtils.scaleValue(time * 1000, 3) : 0L;

0 commit comments

Comments
 (0)