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,