Browse Source

#16 check if port is blank.

Shinsuke Sugaya 11 years ago
parent
commit
a81ea90003
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/main/java/jp/sf/fess/ds/impl/FileListDataStoreImpl.java

+ 6 - 4
src/main/java/jp/sf/fess/ds/impl/FileListDataStoreImpl.java

@@ -272,10 +272,12 @@ public class FileListDataStoreImpl extends CsvDataStoreImpl {
                     final SmbAuthentication smbAuth = new SmbAuthentication();
                     final SmbAuthentication smbAuth = new SmbAuthentication();
                     smbAuth.setDomain(domain == null ? "" : domain);
                     smbAuth.setDomain(domain == null ? "" : domain);
                     smbAuth.setServer(hostname);
                     smbAuth.setServer(hostname);
-                    try {
-                        smbAuth.setPort(Integer.parseInt(port));
-                    } catch (final NumberFormatException e) {
-                        logger.warn("Failed to parse " + port, e);
+                    if (StringUtil.isNotBlank(port)) {
+                        try {
+                            smbAuth.setPort(Integer.parseInt(port));
+                        } catch (final NumberFormatException e) {
+                            logger.warn("Failed to parse " + port, e);
+                        }
                     }
                     }
                     smbAuth.setUsername(username);
                     smbAuth.setUsername(username);
                     smbAuth.setPassword(password == null ? "" : password);
                     smbAuth.setPassword(password == null ? "" : password);