fix #3714: NPE in deleteDirectory()
Merge branch 'release' into upstream