diff --git a/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/AdapterUtils.java b/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/AdapterUtils.java index 35d99092b..e1103a5a3 100644 --- a/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/AdapterUtils.java +++ b/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/AdapterUtils.java @@ -68,10 +68,12 @@ public static boolean isWindows() { * @return the absolute file path */ public static String sourceLookup(String[] sourcePaths, String sourceName) { - for (String path : sourcePaths) { - Path fullpath = Paths.get(path, sourceName); - if (Files.isRegularFile(fullpath)) { - return fullpath.toString(); + if (sourcePaths != null) { + for (String path : sourcePaths) { + Path fullpath = Paths.get(path, sourceName); + if (Files.isRegularFile(fullpath)) { + return fullpath.toString(); + } } } return null; diff --git a/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchWithoutDebuggingDelegate.java b/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchWithoutDebuggingDelegate.java index 804ee58ca..c993dc5f1 100644 --- a/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchWithoutDebuggingDelegate.java +++ b/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/LaunchWithoutDebuggingDelegate.java @@ -137,6 +137,6 @@ public CompletableFuture launchInTerminal(LaunchArguments launchArgume @Override public void preLaunch(LaunchArguments launchArguments, IDebugAdapterContext context) { - // TODO Auto-generated method stub + context.setSourcePaths(launchArguments.sourcePaths); } }