diff options
author | sminto | 2005-08-17 16:43:46 +0000 |
---|---|---|
committer | sminto | 2005-08-17 16:43:46 +0000 |
commit | 2974b61b4b642639a957abe699efa92fdf47a2b1 (patch) | |
tree | 73390426381d582fc7926f664e5607bad6404e0e /org.eclipse.mylyn.bugzilla.ui | |
parent | 1613c77adc6c18f1133e88928741182b8f5dfbae (diff) | |
download | org.eclipse.mylyn.tasks-2974b61b4b642639a957abe699efa92fdf47a2b1.tar.gz org.eclipse.mylyn.tasks-2974b61b4b642639a957abe699efa92fdf47a2b1.tar.xz org.eclipse.mylyn.tasks-2974b61b4b642639a957abe699efa92fdf47a2b1.zip |
fixed Bug #106924: npe when no products are available
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/NewBugWizard.java | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/NewBugWizard.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/NewBugWizard.java index 59956b57f..2c16bf603 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/NewBugWizard.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/NewBugWizard.java @@ -90,26 +90,33 @@ public class NewBugWizard extends AbstractBugWizard { } } - if (WizardProductPage.products.size() != 0 - && BugzillaPlugin.getDefault().getProductConfiguration() - .getProducts().length > 1) { - productPage = new WizardProductPage(workbenchInstance, this); - addPage(productPage); - } else { - // There wasn't a list of products so there must only be 1 - if (!model.hasParsedAttributes()) { - if (model.isConnected()) - BugzillaRepository.getInstance().getnewBugAttributes(model, - true); - else - BugzillaRepository.getInstance().getProdConfigAttributes( - model); - model.setParsedAttributesStatus(true); + try { + if (WizardProductPage.products.size() != 0 + && BugzillaPlugin.getDefault().getProductConfiguration() + .getProducts().length > 1) { + productPage = new WizardProductPage(workbenchInstance, this); + addPage(productPage); + } else { + // There wasn't a list of products so there must only be 1 + if (!model.hasParsedAttributes()) { + if (model.isConnected()) + BugzillaRepository.getInstance().getnewBugAttributes(model, + true); + else + BugzillaRepository.getInstance().getProdConfigAttributes( + model); + model.setParsedAttributesStatus(true); + } + + // add the attributes page to the wizard + attributePage = new WizardAttributesPage(workbenchInstance); + addPage(attributePage); } - - // add the attributes page to the wizard - attributePage = new WizardAttributesPage(workbenchInstance); - addPage(attributePage); + } catch (NullPointerException e){ + // TODO add better error message here + MessageDialog.openError(null, "Bugzilla Error", + "Unable to get the products."); + super.getShell().close(); } } |