diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/DefaultTemplate.kt b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/DefaultTemplate.kt index ced5349ed06c..c5c5afa488b9 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/DefaultTemplate.kt +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/DefaultTemplate.kt @@ -101,8 +101,9 @@ class DefaultTemplate(val name: String, if (text == null) { logger().error("Cannot find file by path: $fullPath") + return "Unexpected error occurred" } - return text ?: "" + return text } // the only external usage - https://github.com/wrdv/testme-idea/blob/8e314aea969619f43f0c6bb17f53f1d95b1072be/src/main/java/com/weirddev/testme/intellij/ui/template/FTManager.java#L200 diff --git a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplatesLoader.kt b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplatesLoader.kt index 37f589444878..f1cb78169509 100644 --- a/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplatesLoader.kt +++ b/platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FileTemplatesLoader.kt @@ -342,8 +342,9 @@ private fun getLocalizedContent(path: String, pathResolver: Function().error("Cannot find file by path: $path") + return "Unexpected error occurred" } - return result ?: "" + return result } private fun loadFileContent(root: Path, filePath: String): String? {