Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2018-10-11 13:28:32 -0400
committerRoland Grunberg2018-10-26 09:40:08 -0400
commitd3020689a3538017aa8a765b3f28c4f06f867956 (patch)
tree2f4849f669b4faf2c27e51ba60d149d32f9188a4
parentac10dcb9a7b35618e02c5074137977066d4570d7 (diff)
downloadeclipse.platform.text-d3020689a3538017aa8a765b3f28c4f06f867956.tar.gz
eclipse.platform.text-d3020689a3538017aa8a765b3f28c4f06f867956.tar.xz
eclipse.platform.text-d3020689a3538017aa8a765b3f28c4f06f867956.zip
Bug 539849 - Guard against NPE in TemplateStore.getRegistry().I20181027-1800
When the underlying ContextTypeRegistry is null for TemplateStoreCore.getRegistry(), it indicates that all templates should be loaded, so simply return null in TemplateStore.getRegistry(). Change-Id: I5ddf2400e4eeb68f269555f24a48dd3cfee008ba Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java
index 31ab113b2..c02a62941 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java
@@ -224,6 +224,9 @@ public class TemplateStore extends TemplateStoreCore {
@Override
protected final org.eclipse.jface.text.templates.ContextTypeRegistry getRegistry() {
ContextTypeRegistry registry= super.getRegistry();
+ if (registry == null) {
+ return null;
+ }
org.eclipse.jface.text.templates.ContextTypeRegistry res= new org.eclipse.jface.text.templates.ContextTypeRegistry();
registry.contextTypes().forEachRemaining(t -> res.addContextType(t));
return res;

Back to the top