From 2358322ab50a189ed87dca2aacff274ac1b328df Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Tue, 4 Jun 2013 14:42:47 -0700 Subject: [PATCH] Bug 409896 - NPE in StubUtility.getFileContent when the template is empty --- .../cdt/internal/corext/codemanipulation/StubUtility.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java index e116bb286ad..8c78f87894a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/StubUtility.java @@ -212,7 +212,7 @@ public class StubUtility { String[] fullLine= { CodeTemplateContextType.FILE_COMMENT }; String text = evaluateTemplate(context, template, fullLine); - if (!text.endsWith(lineDelimiter)) + if (text != null && !text.endsWith(lineDelimiter)) text += lineDelimiter; return text; }