Author: rob.stryker(a)jboss.com
Date: 2009-09-21 14:24:33 -0400 (Mon, 21 Sep 2009)
New Revision: 17683
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
JBIDE-4912 - fixed an NPE
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2009-09-21
17:59:29 UTC (rev 17682)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2009-09-21
18:24:33 UTC (rev 17683)
@@ -474,13 +474,15 @@
copyFile(file.getContents(), path, file.getLocalTimeStamp(), mf);
else {
File file2 = (File) mf.getAdapter(File.class);
- InputStream in = null;
- try {
- in = new FileInputStream(file2);
- } catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorReading, file2.getAbsolutePath()), e));
- }
- copyFile(in, path, file2.lastModified(), mf);
+ if( file2 != null ) {
+ InputStream in = null;
+ try {
+ in = new FileInputStream(file2);
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorReading, file2.getAbsolutePath()), e));
+ }
+ copyFile(in, path, file2.lastModified(), mf);
+ } // else silently ignore I guess
}
}