From 3996d330a6ac321ed0b008c4ae9598605f95c918 Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 30 Jul 2024 00:14:51 +0000 Subject: [PATCH] Fix possible NPE --- .../java/io/xpipe/app/browser/file/BrowserFileListModel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListModel.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListModel.java index 265cd4e85..676d11174 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListModel.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListModel.java @@ -99,6 +99,10 @@ public final class BrowserFileListModel { } public BrowserEntry rename(BrowserEntry old, String newName) { + if (fileSystemModel == null || fileSystemModel.isClosed() || fileSystemModel.getCurrentPath().get() == null) { + return old; + } + var fullPath = FileNames.join(fileSystemModel.getCurrentPath().get(), old.getFileName()); var newFullPath = FileNames.join(fileSystemModel.getCurrentPath().get(), newName);