Don't crash when metadata contains private top level type.
authorMarek Safar <marek.safar@gmail.com>
Mon, 22 Jul 2013 11:44:11 +0000 (13:44 +0200)
committerMarek Safar <marek.safar@gmail.com>
Mon, 22 Jul 2013 11:44:11 +0000 (13:44 +0200)
mcs/mcs/decl.cs

index e7f27aa7d626a32151675707335df0dc6312ff5f..048d17220dd30b2b3304fcca8cc0d01590e7c974 100644 (file)
@@ -1161,7 +1161,7 @@ namespace Mono.CSharp {
                        var ctype = ctx.CurrentType;
 
                        if (ma == Modifiers.PRIVATE) {
-                               if (ctype == null)
+                               if (ctype == null || parentType == null)
                                        return false;
                                //
                                // It's only accessible to the current class or children