From 785ead708f67c6d802a5054f09b4b1e422f556af Mon Sep 17 00:00:00 2001 From: Dan D'Avella Date: Thu, 11 Jul 2024 16:51:08 -0400 Subject: [PATCH] Skip SensitiveDataLoggingCodemod when LLM not available (#419) This codemod does not inherit from the base class with the existing check so it did not benefit from the work in #418. --- .../io/codemodder/codemods/SensitiveDataLoggingCodemod.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-codemods/src/main/java/io/codemodder/codemods/SensitiveDataLoggingCodemod.java b/core-codemods/src/main/java/io/codemodder/codemods/SensitiveDataLoggingCodemod.java index 599f0c6fe..6705b00ea 100644 --- a/core-codemods/src/main/java/io/codemodder/codemods/SensitiveDataLoggingCodemod.java +++ b/core-codemods/src/main/java/io/codemodder/codemods/SensitiveDataLoggingCodemod.java @@ -119,6 +119,9 @@ private static Optional getSingleStatement( @Override public boolean shouldRun() { + if (!service.isServiceAvailable()) { + return false; + } List runs = sarif.rawDocument().getRuns(); return runs != null && !runs.isEmpty() && !runs.get(0).getResults().isEmpty(); }