| 
1 | 1 | 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  | 
2 |  | -index a72abd44ef..199ffad108 100644  | 
 | 2 | +index a72abd44ef..72e8bd68ec 100644  | 
3 | 3 | --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java  | 
4 | 4 | +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java  | 
5 |  | -@@ -423,7 +423,7 @@ public final class MoveRefactoring extends CodeRefactoring {  | 
 | 5 | +@@ -420,18 +420,26 @@ public final class MoveRefactoring extends CodeRefactoring {  | 
 | 6 | +         }  | 
 | 7 | +   | 
 | 8 | +         private static Project getSelectedProject(NamedPath selectedProject) {  | 
 | 9 | ++            String path = selectedProject == null ? null : selectedProject.getPath();  | 
 | 10 | ++            if (path == null) {  | 
 | 11 | ++                return null;  | 
 | 12 | ++            }  | 
 | 13 | ++            FileObject file;  | 
6 | 14 |              try {  | 
7 |  | -                 String path = selectedProject.getPath();  | 
8 |  | -                 return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null;  | 
9 |  | --            } catch (MalformedURLException ex) {  | 
10 |  | -+            } catch (MalformedURLException | NullPointerException ex) {  | 
11 |  | -                 return null;  | 
 | 15 | +-                String path = selectedProject.getPath();  | 
 | 16 | +-                return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null;  | 
 | 17 | ++                file = Utils.fromUri(path);  | 
 | 18 | +             } catch (MalformedURLException ex) {  | 
 | 19 | +-                return null;  | 
 | 20 | ++                file = null;  | 
12 | 21 |              }  | 
 | 22 | ++            return file == null ? null : FileOwnerQuery.getOwner(file);  | 
13 | 23 |          }  | 
14 |  | -@@ -432,7 +432,7 @@ public final class MoveRefactoring extends CodeRefactoring {  | 
 | 24 | +   | 
 | 25 | +         private static FileObject getSelectedRoot(NamedPath selectedRoot) {  | 
 | 26 | ++            String path = selectedRoot == null ? null : selectedRoot.getPath();  | 
 | 27 | ++            if (path == null) {  | 
 | 28 | ++                return null;  | 
 | 29 | ++            }  | 
15 | 30 |              try {  | 
16 |  | -                 String path = selectedRoot.getPath();  | 
17 |  | -                 return path != null ? Utils.fromUri(path) : null;  | 
18 |  | --            } catch (MalformedURLException ex) {  | 
19 |  | -+            } catch (MalformedURLException | NullPointerException ex) {  | 
 | 31 | +-                String path = selectedRoot.getPath();  | 
 | 32 | +-                return path != null ? Utils.fromUri(path) : null;  | 
 | 33 | ++                return Utils.fromUri(path);  | 
 | 34 | +             } catch (MalformedURLException ex) {  | 
20 | 35 |                  return null;  | 
21 | 36 |              }  | 
22 |  | -         }  | 
 | 
0 commit comments