mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fix for 172227, by Ed Swartz, NPE when opening type hierarchy from external file
This commit is contained in:
parent
8d30f9ff11
commit
062bd88019
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
|
* Ed Swartz (Nokia)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.viewsupport;
|
package org.eclipse.cdt.internal.ui.viewsupport;
|
||||||
|
@ -128,10 +129,10 @@ public class IndexUI {
|
||||||
ITranslationUnit tu= getTranslationUnit(preferProject, declName);
|
ITranslationUnit tu= getTranslationUnit(preferProject, declName);
|
||||||
if (tu != null) {
|
if (tu != null) {
|
||||||
IFile file= (IFile) tu.getResource();
|
IFile file= (IFile) tu.getResource();
|
||||||
long timestamp= file.getLocalTimeStamp();
|
long timestamp= file != null ? file.getLocalTimeStamp() : 0;
|
||||||
IASTFileLocation loc= declName.getFileLocation();
|
IASTFileLocation loc= declName.getFileLocation();
|
||||||
IRegion region= new Region(loc.getNodeOffset(), loc.getNodeLength());
|
IRegion region= new Region(loc.getNodeOffset(), loc.getNodeLength());
|
||||||
IPositionConverter converter= CCorePlugin.getPositionTrackerManager().findPositionConverter(file, timestamp);
|
IPositionConverter converter= CCorePlugin.getPositionTrackerManager().findPositionConverter(tu, timestamp);
|
||||||
if (converter != null) {
|
if (converter != null) {
|
||||||
region= converter.actualToHistoric(region);
|
region= converter.actualToHistoric(region);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue