Skip to content

Commit 7552b6b

Browse files
committed
chore: fail fast when the toml file is not Cargo.toml
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent 9195b50 commit 7552b6b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/org/jboss/tools/intellij/componentanalysis/cargo/CargoCAAnnotator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ protected String getInspectionShortName() {
6868

6969
@Override
7070
protected Map<Dependency, List<PsiElement>> getDependencies(PsiFile file) {
71+
if (!"Cargo.toml".equals(file.getName())) {
72+
return Map.of();
73+
}
74+
7175
Map<Dependency, List<PsiElement>> resultMap = new HashMap<>();
7276

7377
Set<String> commentIgnoredDeps = getIgnoredDependencies(file);
@@ -337,4 +341,4 @@ private void parseFlatDependencies(TomlTable table, Set<String> ignoredDeps, Map
337341
resultMap.computeIfAbsent(dp, k -> new LinkedList<>()).add(keyValue);
338342
}
339343
}
340-
}
344+
}

0 commit comments

Comments
 (0)