Skip to content

Commit

Permalink
Added null checks for selected values in the MoveRefactoring code action
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam71 committed Nov 7, 2024
1 parent d0ad358 commit 0bb6141
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ void doRefactoring(MoveElementUI ui) {
}

private static Project getSelectedProject(NamedPath selectedProject) {
if (selectedProject == null) {
return null;
}
try {
String path = selectedProject.getPath();
return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null;
Expand All @@ -429,6 +432,9 @@ private static Project getSelectedProject(NamedPath selectedProject) {
}

private static FileObject getSelectedRoot(NamedPath selectedRoot) {
if (selectedRoot == null) {
return null;
}
try {
String path = selectedRoot.getPath();
return path != null ? Utils.fromUri(path) : null;
Expand Down

0 comments on commit 0bb6141

Please sign in to comment.