tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kfuj...@apache.org
Subject svn commit: r1509134 - /tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
Date Thu, 01 Aug 2013 09:12:47 GMT
Author: kfujino
Date: Thu Aug  1 09:12:47 2013
New Revision: 1509134

URL: http://svn.apache.org/r1509134
Log:
Fix NPE in FileMessageFactory.main when specify empty file as arguments.

Modified:
    tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java

Modified: tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java?rev=1509134&r1=1509133&r2=1509134&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java Thu Aug  1 09:12:47
2013
@@ -374,6 +374,10 @@ public class FileMessageFactory {
         FileMessageFactory write = getInstance(new File(args[1]), true);
         FileMessage msg = new FileMessage(null, args[0], args[0]);
         msg = read.readMessage(msg);
+        if (msg == null) {
+            System.out.println("Empty input file : " + args[0]);
+            return;
+        }
         System.out.println("Expecting to write " + msg.getTotalNrOfMsgs()
                 + " messages.");
         int cnt = 0;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message