diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/NewHeaderFileCreationWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/NewHeaderFileCreationWizardPage.java index e8716a83762..1e03364d5f1 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/NewHeaderFileCreationWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/filewizard/NewHeaderFileCreationWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 QNX Software Systems and others. + * Copyright (c) 2004, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -154,8 +154,10 @@ public class NewHeaderFileCreationWizardPage extends AbstractFileCreationWizardP if (fNewFileTU != null) { String lineDelimiter= StubUtility.getLineDelimiterUsed(fNewFileTU); String content= CodeGeneration.getHeaderFileContent(getSelectedTemplate(), fNewFileTU, null, null, lineDelimiter); - fNewFileTU.getBuffer().setContents(content.toCharArray()); - fNewFileTU.save(monitor, true); + if (content != null) { + fNewFileTU.getBuffer().setContents(content.toCharArray()); + fNewFileTU.save(monitor, true); + } } } } finally {