Skip to content

Commit

Permalink
Modify cleanFileName method
Browse files Browse the repository at this point in the history
  • Loading branch information
tharikaGitHub committed Jul 2, 2024
1 parent 1263307 commit bcbb332
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,12 @@ private static String cleanFolderName(String name) {
* @return Folder name which the unwanted characters are replaced
*/
private static String cleanFileName(String name) {
// Replace everything but [a-zA-Z0-9.-]
return name.replaceAll("[^a-zA-Z0-9\\.\\-]", "_");
String docName = name;
if (docName != null) {
// Replace everything but [a-zA-Z0-9.-]
docName = docName.replaceAll("[^a-zA-Z0-9\\.\\-]", "_");
}
return docName;
}

/**
Expand Down

0 comments on commit bcbb332

Please sign in to comment.