Skip to content

Commit

Permalink
Merge pull request #223 from Bhashinee/release-4.0.31
Browse files Browse the repository at this point in the history
Fix the null pointer when closing the file system if the connection fails to establish
  • Loading branch information
Bhashinee authored Sep 3, 2024
2 parents e5b2d2d + 9955e91 commit cfef1de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .connector-store/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"releases": [
{
"tagName": "v4.0.29",
"tagName": "v4.0.31",
"products": [
"EI 7.1.0",
"EI 6.6.0",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.esb.connector</groupId>
<artifactId>org.wso2.carbon.esb.connector.file</artifactId>
<version>4.0.30</version>
<version>4.0.31</version>
<packaging>jar</packaging>
<name>WSO2 Carbon - Connector For esb-connector-file</name>
<url>http://wso2.org</url>
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/org/wso2/carbon/connector/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,13 @@ public static String maskURLPassword(String url) {
public static void closeFileSystem(FileObject fileObject) {
try {
//Close the File system if it is not already closed
if (fileObject != null && fileObject.getParent() != null && fileObject.getParent().getFileSystem() != null) {
fileObject.getParent().getFileSystem().getFileSystemManager().closeFileSystem(fileObject.getFileSystem());
if (fileObject != null) {
if (fileObject.getParent() != null && fileObject.getParent().getFileSystem() != null) {
fileObject.getParent().getFileSystem().getFileSystemManager()
.closeFileSystem(fileObject.getFileSystem());
}
fileObject.close();
}
fileObject.close();
} catch (FileSystemException warn) {
String message = "Error on closing the file: " + fileObject.getName().getPath();
log.warn(message, warn);
Expand Down

0 comments on commit cfef1de

Please sign in to comment.