1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 328068 - Creation of element failed error when creating new C++ class

This commit is contained in:
Anton Leherbauer 2010-10-22 08:25:56 +00:00
parent a76a17353c
commit b78e2ea29a

View file

@ -187,7 +187,7 @@ public class StubUtility {
context.setVariable(CodeTemplateContextType.ENCLOSING_TYPE, typeName);
context.setVariable(CodeTemplateContextType.BODY_STATEMENT, bodyStatement != null ? bodyStatement : ""); //$NON-NLS-1$
String str= evaluateTemplate(context, template, new String[] { CodeTemplateContextType.BODY_STATEMENT });
if (str == null && !Strings.containsOnlyWhitespaces(bodyStatement)) {
if (str == null && bodyStatement != null && !Strings.containsOnlyWhitespaces(bodyStatement)) {
return bodyStatement;
}
return str;