Menu

#112 NullPointerException on selection of protected directory

open
VFS (6)
5
2012-10-29
2007-05-17
Anonymous
No

An internal error occurred during: "Retrieving contents for directory file:///C:/System Volume Information".

Occurre when I select this directory on Windows XP Pro

NullPointerException on class VfsManagerExtension
Method: hasChildDirectories (ligne 215)

currentParent.getChildren(); return null in this case
so replacing

if(children.length > 0) {
by
<<if(children != null) {
must fix it

PS: The 'Multiple Error Dialog' appears many times because each times the dialog is close, there is a retry to read the directory...

Discussion

  • Dan Corneanu

    Dan Corneanu - 2010-01-22

    I can confirm the bug, but I get a a NullPointerException in method FileControlModel.getContent(). The javadoc for FileObject.getChildren() says it never returns Null. It seems that the vfs implementation we are using returns null if you get an "access denied" from the os. I have made a test with the last release of vfs and the getChildren() method now throws a FileNotFolderException.

    1. One solution would be to switch to the last release of vfs.
    2. The other solution would be to guard all calls to FileObjec.getChildren() (13 occurrences) with a test for null.

    Can one of the project's admins decide which way is better?

     
  • Dan Corneanu

    Dan Corneanu - 2010-02-08

    The first version of the fix can be found in the ID_1720501 branch. I have added support for the callers of doRefresh() to be notified of the result of the execution.

    Why do we need FileTableControl.doRefresh() do it's job in 2 steps? Can't we move the content of syncExec() in the Job's run() method? The result will be the same but the code would be much clear and dealing with exceptions would be much easier.

    Can anybody review my changes please ?

     
  • Dan Corneanu

    Dan Corneanu - 2010-03-07

    Robert,
    would it be OK to merge the changes on the branch into the HEAD ?

     

Log in to post a comment.

MongoDB Logo MongoDB