1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fixed NPE

This commit is contained in:
David Inglis 2004-06-21 17:49:20 +00:00
parent d537a34599
commit 515919579d

View file

@ -132,13 +132,15 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
if (resource != null && resource.getType() == IResource.PROJECT) { if (resource != null && resource.getType() == IResource.PROJECT) {
if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) { if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) {
IDocumentPartitioner partioner = (IDocumentPartitioner)fConsoleMap.remove(resource); IDocumentPartitioner partioner = (IDocumentPartitioner)fConsoleMap.remove(resource);
partioner.disconnect(); if (partioner != null) {
Object[] list = listeners.getListeners(); partioner.disconnect();
if (list.length > 0) { Object[] list = listeners.getListeners();
for (int i = 0; i < list.length; i++) { if (list.length > 0) {
IBuildConsoleListener listener = (IBuildConsoleListener)list[i]; for (int i = 0; i < list.length; i++) {
ConsoleEvent consoleEvent = new ConsoleEvent(this, (IProject)resource, ConsoleEvent.CONSOLE_CLOSE); IBuildConsoleListener listener = (IBuildConsoleListener)list[i];
listener.consoleChange(consoleEvent); ConsoleEvent consoleEvent = new ConsoleEvent(this, (IProject)resource, ConsoleEvent.CONSOLE_CLOSE);
listener.consoleChange(consoleEvent);
}
} }
} }
} }