removed unused dependencies, replaced deprecated code and declarations
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / wizards / PHPFileWizard.java
index 6e6b2da..89674df 100644 (file)
@@ -9,7 +9,7 @@ package net.sourceforge.phpeclipse.wizards;
 
  Contributors:
  IBM Corporation - Initial implementation
- Klaus Hartlage - www.eclipseproject.de
+ www.phpeclipse.de
  **********************************************************************/
 
 import java.io.ByteArrayInputStream;
@@ -195,7 +195,11 @@ public class PHPFileWizard extends Wizard implements INewWizard {
       String lineDelimiter = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
       CodeTemplateContext context = new CodeTemplateContext(template.getContextTypeId(), null, lineDelimiter);
       context.setFileNameVariable(fileName);
-      return new ByteArrayInputStream(StubUtility.evaluateTemplate(context, template).getBytes());
+      String content=StubUtility.evaluateTemplate(context, template);
+      if (content==null) {
+         content="";
+      }
+      return new ByteArrayInputStream(content.getBytes());
     } catch (CoreException e) {
       e.printStackTrace();
       return null;