Skip to content

Commit

Permalink
Patch for MoveRefactoring null error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam71 committed Oct 30, 2024
1 parent f50358c commit 6d12f01
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
patches/7750.diff
patches/7910.diff
patches/7921.diff
patches/7923_draft.diff
patches/mvn-sh.diff
patches/generate-dependencies.diff
patches/rename-debugger.diff
Expand Down
22 changes: 22 additions & 0 deletions patches/7923_draft.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
index a72abd44ef..199ffad108 100644
--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
+++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
@@ -423,7 +423,7 @@ public final class MoveRefactoring extends CodeRefactoring {
try {
String path = selectedProject.getPath();
return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null;
- } catch (MalformedURLException ex) {
+ } catch (MalformedURLException | NullPointerException ex) {
return null;
}
}
@@ -432,7 +432,7 @@ public final class MoveRefactoring extends CodeRefactoring {
try {
String path = selectedRoot.getPath();
return path != null ? Utils.fromUri(path) : null;
- } catch (MalformedURLException ex) {
+ } catch (MalformedURLException | NullPointerException ex) {
return null;
}
}

0 comments on commit 6d12f01

Please sign in to comment.