GP-4510: fix for NPEs

This commit is contained in:
d-millar 2024-04-11 14:16:52 -04:00
parent 80bae5242c
commit b6075d08ef
4 changed files with 11 additions and 5 deletions

View file

@ -59,7 +59,7 @@ import sarif.io.SarifIO;
packageName = MiscellaneousPluginPackage.NAME,
category = PluginCategoryNames.ANALYSIS,
shortDescription = "Sarif Plugin.",
description = "From sarif parsing to DL modelling"
description = "SARIF parsing and visualization plugin."
)
//@formatter:on

View file

@ -41,8 +41,8 @@ public class SarifObject implements IsfObject {
if (SARIF) {
message = new JsonObject();
message.addProperty("text", key);
kind = "INFORMATIONAL";
level = "NONE";
kind = "informational"; // convention specifies lower-case
level = "none";
ruleId = ruleKey;
properties = new JsonObject();
properties.add("additionalProperties", element);

View file

@ -24,7 +24,10 @@ public class SarifKindResultHandler extends SarifResultHandler {
}
public String parse() {
return result.getKind().toString();
if (result.getKind() != null) {
return result.getKind().toString();
}
return "none";
}
}

View file

@ -24,7 +24,10 @@ public class SarifLevelResultHandler extends SarifResultHandler {
}
public String parse() {
return result.getLevel().toString();
if (result.getLevel() != null) {
return result.getLevel().toString();
}
return "none";
}
}