diff options
author | relves | 2008-07-02 19:33:55 +0000 |
---|---|---|
committer | relves | 2008-07-02 19:33:55 +0000 |
commit | 45967b94542bf2812bf72a717483b1052f11e930 (patch) | |
tree | 2e292ed49e0ec822264b6cff0412d471d991be0d /org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard | |
parent | 44f6cc3d124a8b8b724889af51f513294eba4a01 (diff) | |
download | org.eclipse.mylyn.tasks-45967b94542bf2812bf72a717483b1052f11e930.tar.gz org.eclipse.mylyn.tasks-45967b94542bf2812bf72a717483b1052f11e930.tar.xz org.eclipse.mylyn.tasks-45967b94542bf2812bf72a717483b1052f11e930.zip |
NEW - bug 239323: fix potential index out of bounds error
https://bugs.eclipse.org/bugs/show_bug.cgi?id=239323
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java index 57993c9db..b9398ea3c 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java @@ -264,22 +264,25 @@ public class BugzillaProductPage extends WizardPage { query = (IRepositoryQuery) element; } - if (query != null) { + if (query != null && query.getConnectorKind().equals(BugzillaCorePlugin.CONNECTOR_KIND)) { String queryUrl = query.getUrl(); queryUrl = queryUrl.substring(queryUrl.indexOf("?") + 1); String[] options = queryUrl.split("&"); for (String option : options) { - String key = option.substring(0, option.indexOf("=")); - if ("product".equals(key)) { - try { - products.add(URLDecoder.decode(option.substring(option.indexOf("=") + 1), - repository.getCharacterEncoding())); - // TODO: list box only accepts a single selection so - // we break on first found - break; - } catch (UnsupportedEncodingException ex) { - // ignore + int index = option.indexOf("="); + if (index != -1) { + String key = option.substring(0, index); + if ("product".equals(key)) { + try { + products.add(URLDecoder.decode(option.substring(index + 1), + repository.getCharacterEncoding())); + // TODO: list box only accepts a single selection so + // we break on first found + break; + } catch (UnsupportedEncodingException ex) { + // ignore + } } } } |