Skip to content

Commit

Permalink
Merge pull request #5 from rapid7/DCA-22136
Browse files Browse the repository at this point in the history
DCA-22136 Fix empty name parameter
  • Loading branch information
ihorbatiuk-r7 authored Jan 15, 2021
2 parents 257bf77 + cadc60f commit 0fced36
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/com/rapid7/recog/parser/RecogParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public RecogMatchers parse(File file)
* if no matchers are defined, or all matchers are invalid and strict mode is disabled.
* @throws ParseException If an error is encountered and strict-mode is enabled.
*/
public RecogMatchers parse(Reader reader, String name) // TODO: what was name meant to be used for?
public RecogMatchers parse(Reader reader, String name)
throws ParseException {
Document document;
try {
Expand All @@ -99,10 +99,9 @@ public RecogMatchers parse(Reader reader, String name) // TODO: what was name me

String recogKey = root.getAttribute("matches");

if (recogKey.isEmpty() || recogKey == null)
{
LOGGER.warn("Recog Matcher Key is Empty or Null. File Name: " + name);
recogKey = name;
if (recogKey.isEmpty() || recogKey == null) {
LOGGER.debug("Recog Matcher Key is Empty or Null. File Name: " + name);
recogKey = name;
}

RecogMatchers matchers = new RecogMatchers(recogKey, root.getAttribute("protocol"), root.getAttribute("database_type"), preference);
Expand Down

0 comments on commit 0fced36

Please sign in to comment.