Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null exception occured when click on Luke desktop browser button #13345

Open
wuth opened this issue May 6, 2024 · 0 comments
Open

Null exception occured when click on Luke desktop browser button #13345

wuth opened this issue May 6, 2024 · 0 comments
Labels

Comments

@wuth
Copy link

wuth commented May 6, 2024

Description

When I have set my share folder (luncene data) on window,I found that Luke desktop's path browser button occurd null exception.
like path \xxx.xxx.xx.xx\trace . Finally I debug the source code and repair this bug as follow:
java file:OpenIndexDialogFactory.java
function:getLastOpenedDirectory

error:path.getParent()

repair:

   private File getLastOpenedDirectory() {
      List<String> history = prefs.getHistory();
      if (!history.isEmpty()) {
        Path path = Paths.get(history.get(0));
        if (Files.exists(path)) {
          if(path.getParent() != null) {
            return path.getParent().toAbsolutePath().toFile();
          }else {
            return path.toAbsolutePath().toFile();
          }
        }
      }
      return null;
    }

Version and environment details

Luncene 8.11.2 and I have check the newest version code has the same problem.

@wuth wuth added the type:bug label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant