Bug 13779 - [NPE] when category doesn't exist
Summary: [NPE] when category doesn't exist
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Christophe Elek CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-15 08:21 EDT by Christophe Elek CLA
Modified: 2002-04-19 07:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Elek CLA 2002-04-15 08:21:51 EDT
Received NPE when selecting attached site.xml in Updates view
I presume (but may be wrong) it happens because the category of the feature
doesn't exist

java.lang.NullPointerException
	at
org.eclipse.update.internal.ui.model.SiteBookmark.addFeatureToCatalog(SiteBookmark.java:141)
	at
org.eclipse.update.internal.ui.model.SiteBookmark.createCatalog(SiteBookmark.java:97)
	at org.eclipse.update.internal.ui.model.SiteBookmark.connect(SiteBookmark.java:77)
	at org.eclipse.update.internal.ui.views.UpdatesView$9.run(UpdatesView.java:482)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56)
	at
org.eclipse.update.internal.ui.views.UpdatesView.performRefresh(UpdatesView.java:474)
	at org.eclipse.update.internal.ui.views.UpdatesView.access$12(UpdatesView.java:469)
	at org.eclipse.update.internal.ui.views.UpdatesView$6.run(UpdatesView.java:305)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:590)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:407)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:361)
	at
org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:352)
	at
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1412)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:836)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:819)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:777)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:190)
	at org.eclipse.core.launcher.Main.run(Main.java:549)
	at org.eclipse.core.launcher.Main.main(Main.java:390)
Comment 1 Dejan Glozic CLA 2002-04-16 09:27:53 EDT
I would say that core is breaking the contract. You are supposed to supply me 
with an array of non-null category objects. UI code bombs because one of the 
category entires is null. 
Comment 2 Christophe Elek CLA 2002-04-16 21:55:02 EDT
NPE -> P1
Comment 3 Christophe Elek CLA 2002-04-19 07:42:09 EDT
FeatureReference.getCategories() now check if 
getSite().getCategory(categoriesAsString[i]);
returns a valid category and not null.