Bug 509044: NullPointerException in TypeModel.getMembers
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
index 0dda30c..09c4f66 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java
@@ -204,7 +204,7 @@
             AbstractMethodDeclaration[] methods = this._ast.methods;
             if (methods != null) {
                 for (int i=0; i<methods.length; i++) {
-                    if (methods[i].scope != null) {
+                    if (methods[i] != null && methods[i].scope != null) {
                         ClassScope[] scopes = methods[i].scope.getAllLocalTypes();
                         for (int j=0; j<scopes.length; j++) {
                             TypeDeclaration type = scopes[j].referenceContext;