1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix for 235308: NPE while header file creation with no template

This commit is contained in:
Anton Leherbauer 2008-06-03 12:31:05 +00:00
parent d25d393211
commit 396d3783d0

View file

@ -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 {