From f11b27d36a88a29ee88555a618275a78521c1903 Mon Sep 17 00:00:00 2001 From: bananeweizen Date: Mon, 19 Dec 2005 22:13:08 +0000 Subject: [PATCH] bug 1365831, error for creating new file with empty new PHP file template --- .../phpeclipse/wizards/PHPFileWizard.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/PHPFileWizard.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/PHPFileWizard.java index 971f3b6..89674df 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/PHPFileWizard.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/wizards/PHPFileWizard.java @@ -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; -- 1.7.1