Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Chouinard2012-07-17 17:30:08 -0400
committerFrancois Chouinard2012-07-17 17:33:48 -0400
commitc555be09fd7d27a0b0d8f3b104b9e18a3015590f (patch)
tree7ab56b8b53ae8ba22d2bd248b6668c0b5212d3e9
parent1859f913bd25ce9e9bc6267367982510c257eb75 (diff)
downloadorg.eclipse.linuxtools-c555be09fd7d27a0b0d8f3b104b9e18a3015590f.tar.gz
org.eclipse.linuxtools-c555be09fd7d27a0b0d8f3b104b9e18a3015590f.tar.xz
org.eclipse.linuxtools-c555be09fd7d27a0b0d8f3b104b9e18a3015590f.zip
Fix for Bug383047
Change-Id: Ib311436f740c382d4d828713a4f2d762d63c326d Signed-off-by: Francois Chouinard <fchouinard@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
index 5ee2870c5d..5b9bffc93d 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010, 2011, 2012 Ericsson
+ * Copyright (c) 2009, 2010, 2011, 2012 Ericsson and others.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -10,6 +10,7 @@
* Francois Chouinard - Initial API and implementation
* Francois Chouinard - Got rid of dependency on internal platform class
* Francois Chouinard - Complete re-design
+ * Anna Dushistova(Montavista) - [383047] NPE while importing a CFT trace
*******************************************************************************/
package org.eclipse.linuxtools.tmf.ui.project.wizards;
@@ -53,6 +54,7 @@ import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefin
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.TmfProjectNature;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
+import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectRegistry;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder;
@@ -893,10 +895,13 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
resource.setPersistentProperty(TmfCommonConstants.TRACEBUNDLE, traceBundle);
resource.setPersistentProperty(TmfCommonConstants.TRACETYPE, traceTypeId);
resource.setPersistentProperty(TmfCommonConstants.TRACEICON, traceIcon);
- for (TmfTraceElement traceElement : TmfProjectRegistry.getProject(resource.getProject()).getTracesFolder().getTraces()) {
- if (traceElement.getName().equals(resource.getName())) {
- traceElement.refreshTraceType();
- break;
+ TmfProjectElement tmfProject = TmfProjectRegistry.getProject(resource.getProject());
+ if (tmfProject != null) {
+ for (TmfTraceElement traceElement : tmfProject.getTracesFolder().getTraces()) {
+ if (traceElement.getName().equals(resource.getName())) {
+ traceElement.refreshTraceType();
+ break;
+ }
}
}
} catch (CoreException e) {

Back to the top