Deleting opening Tag causes IDE Error with NullPointerException
Deleting the first line of
<f:if condition="{settings.commentThread.enableRatings} && {comment.rating} > 0">
<div class="comment-rating-display">
<f:render partial="Rating" arguments="{rating: comment.rating}" />
</div>
</f:if>
caused this exception:
java.lang.NullPointerException
at de.sgalinski.typoscript.editor.utility.TypoScriptFileTreeUtility.<init>(TypoScriptFileTreeUtility.java:60)
at de.sgalinski.typoscript.editor.completion.TypoScriptCommonKeyCompletion.<init>(TypoScriptCommonKeyCompletion.java:49)
at de.sgalinski.typoscript.editor.completion.TypoScriptKeyCompletionProvider.addCompletions(TypoScriptKeyCompletionProvider.java:43)
at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:141)
at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:87)
at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:149)
at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142)
at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:96)
at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36)
at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:141)
at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:87)
at com.intellij.codeInsight.completion.impl.CompletionServiceImpl.performCompletion(CompletionServiceImpl.java:63)
at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:827)
at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:812)
at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$null$2(CodeCompletionHandlerBase.java:272)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1168)
at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:169)
at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$doComplete$3(CodeCompletionHandlerBase.java:269)
at com.intellij.codeInsight.completion.AsyncCompletion.lambda$null$0(CompletionThreading.java:95)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:91)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
The TypoScript that gets used in the Fluid code:
setup.txt
plugin.tx_sgcomments {
view {
...
}
settings {
...
# Default settings for a comment thread
commentThread {
...
# Enable the rating feature
enableRatings = {$plugin.tx_sgcomments.settings.commentThread.enableRatings}
}
}
}
constants.txt
plugin.tx_sgcomments {
view {
...
}
settings {
...
commentThread {
# cat=plugin.tx_sgcomments; type=boolean; label=Enable the rating feature
enableRatings = 0
}
...
}
}
}