From 6a5fd7837a6e7a17bf1464dc827ae0abe57ecdcd Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 11 Apr 2012 13:50:17 +0200 Subject: [PATCH] NPE --- .../facet/impl/ProjectWideFacetListenersRegistryImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/facet/impl/ProjectWideFacetListenersRegistryImpl.java b/platform/lang-impl/src/com/intellij/facet/impl/ProjectWideFacetListenersRegistryImpl.java index 42be07c3b319..daa6e8f3a7f7 100644 --- a/platform/lang-impl/src/com/intellij/facet/impl/ProjectWideFacetListenersRegistryImpl.java +++ b/platform/lang-impl/src/com/intellij/facet/impl/ProjectWideFacetListenersRegistryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -176,7 +176,10 @@ public class ProjectWideFacetListenersRegistryImpl extends ProjectWideFacetListe } public void unregisterListener(@NotNull FacetTypeId typeId, @NotNull ProjectWideFacetListener listener) { - myDispatchers.get(typeId).removeListener(listener); + final EventDispatcher dispatcher = myDispatchers.get(typeId); + if (dispatcher != null) { + dispatcher.removeListener(listener); + } } public void registerListener(@NotNull final FacetTypeId typeId, @NotNull final ProjectWideFacetListener listener,