mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix NPE in action adapters when editor is not fed by a file.
This commit is contained in:
parent
cfc37b5788
commit
83332ab6f8
2 changed files with 6 additions and 2 deletions
|
@ -152,11 +152,13 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
|
||||||
if ( document == null ) {
|
if ( document == null ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String fileName; // actually, absolute path, not just file name
|
String fileName = null; // actually, absolute path, not just file name
|
||||||
try {
|
try {
|
||||||
fileName = getFileName( input );
|
fileName = getFileName( input );
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
|
}
|
||||||
|
if (fileName == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
IDebugTarget debugTarget = null;
|
IDebugTarget debugTarget = null;
|
||||||
|
|
|
@ -155,11 +155,13 @@ public class RunToLineAdapter implements IRunToLineTarget {
|
||||||
if ( document == null ) {
|
if ( document == null ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String fileName; // actually, absolute path, not just file name
|
String fileName = null; // actually, absolute path, not just file name
|
||||||
try {
|
try {
|
||||||
fileName = getFileName( input );
|
fileName = getFileName( input );
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
|
}
|
||||||
|
if (fileName == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
IDebugTarget debugTarget = null;
|
IDebugTarget debugTarget = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue