mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Fixed ClassCastException in CompleteParseASTTest.
This commit is contained in:
parent
6f1acede84
commit
67ad3bb4b0
1 changed files with 5 additions and 2 deletions
|
@ -516,7 +516,9 @@ public class CompleteParseBaseTest extends TestCase
|
|||
|
||||
protected CodeScope getCurrentCodeScope()
|
||||
{
|
||||
return (CodeScope)scopes.peek();
|
||||
if( scopes.peek() instanceof CodeScope )
|
||||
return (CodeScope)scopes.peek();
|
||||
return null;
|
||||
}
|
||||
|
||||
protected Scope popScope()
|
||||
|
@ -714,7 +716,8 @@ public class CompleteParseBaseTest extends TestCase
|
|||
*/
|
||||
public void exitCodeBlock(IASTCodeScope scope) {
|
||||
popScope();
|
||||
getCurrentCodeScope().addNewScope(scope);
|
||||
if( getCurrentCodeScope() != null )
|
||||
getCurrentCodeScope().addNewScope(scope);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue