On Thu, 29 Sep 2022 11:12:41 GMT, Tejesh R <t...@openjdk.org> wrote:

> When a custom `FileView` is used and folder traversal is restricted to a 
> particular directory NPE occurs when user tries to traverse/select other 
> folders except traversable folder. This is caused because when user selects 
> folder other than traversable, the traversal is rejected and hence no file is 
> selected as `currentDirectory` of `JFileChooser`. When user tries to access 
> the restricted folder second time, previous selected file check is failing 
> because of NPE since `getFileChooser().getCurrentDirectory();` is null. To 
> fix the issue, NPE check is added.

This pull request has now been integrated.

Changeset: 33d06188
Author:    Tejesh R <t...@openjdk.org>
Committer: Alexey Ivanov <aiva...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/33d061881350c23b5116b3e555eaa905020636f7
Stats:     117 lines in 2 files changed: 113 ins; 2 del; 2 mod

6616245: NullPointerException when using JFileChooser with a custom FileView

Reviewed-by: aivanov

-------------

PR: https://git.openjdk.org/jdk/pull/10485

Reply via email to