Browse Source

Fix NullReferenceException when mscorlib reference is missing.

pull/21/merge
Daniel Grunwald 14 years ago
parent
commit
0bdc13eed2
  1. 5
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/ArrayReturnType.cs

5
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Implementations/ArrayReturnType.cs

@ -122,13 +122,16 @@ namespace ICSharpCode.SharpDevelop.Dom
public override List<IProperty> GetProperties() public override List<IProperty> GetProperties()
{ {
List<IProperty> l = base.GetProperties(); List<IProperty> l = base.GetProperties();
ArrayIndexer property = new ArrayIndexer(elementType, this.BaseType.GetUnderlyingClass()); IClass systemArray = this.BaseType.GetUnderlyingClass();
if (systemArray != null) {
ArrayIndexer property = new ArrayIndexer(elementType, systemArray);
IReturnType int32 = pc.SystemTypes.Int32; IReturnType int32 = pc.SystemTypes.Int32;
for (int i = 0; i < dimensions; ++i) { for (int i = 0; i < dimensions; ++i) {
property.Parameters.Add(new DefaultParameter("index", int32, DomRegion.Empty)); property.Parameters.Add(new DefaultParameter("index", int32, DomRegion.Empty));
} }
property.Freeze(); property.Freeze();
l.Add(property); l.Add(property);
}
return l; return l;
} }

Loading…
Cancel
Save