mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Fix NPE in CView with EFS resources
This commit is contained in:
parent
a0169fac0d
commit
7686c3bdbc
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -1007,7 +1007,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
||||||
IMemento elementMem = expandedMem.createChild(TAG_ELEMENT);
|
IMemento elementMem = expandedMem.createChild(TAG_ELEMENT);
|
||||||
ICElement e = (ICElement) o;
|
ICElement e = (ICElement) o;
|
||||||
IResource res = e.getResource();
|
IResource res = e.getResource();
|
||||||
if (res != null) {
|
if (res != null && res.getLocation() != null) {
|
||||||
elementMem.putString(TAG_PATH, res.getLocation().toOSString());
|
elementMem.putString(TAG_PATH, res.getLocation().toOSString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1022,7 +1022,7 @@ public class CView extends ViewPart implements ISetSelectionTarget, IPropertyCha
|
||||||
if (elements[i] instanceof ICElement) {
|
if (elements[i] instanceof ICElement) {
|
||||||
ICElement e = (ICElement) elements[i];
|
ICElement e = (ICElement) elements[i];
|
||||||
IResource r = e.getResource();
|
IResource r = e.getResource();
|
||||||
if (r != null) {
|
if (r != null && r.getLocation() != null) {
|
||||||
IMemento elementMem = selectionMem.createChild(TAG_ELEMENT);
|
IMemento elementMem = selectionMem.createChild(TAG_ELEMENT);
|
||||||
elementMem.putString(TAG_PATH, r.getLocation().toString());
|
elementMem.putString(TAG_PATH, r.getLocation().toString());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue