Browse Source

Fix NullReferenceException when mscorlib reference is missing.

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

15
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();
IReturnType int32 = pc.SystemTypes.Int32; if (systemArray != null) {
for (int i = 0; i < dimensions; ++i) { ArrayIndexer property = new ArrayIndexer(elementType, systemArray);
property.Parameters.Add(new DefaultParameter("index", int32, DomRegion.Empty)); IReturnType int32 = pc.SystemTypes.Int32;
for (int i = 0; i < dimensions; ++i) {
property.Parameters.Add(new DefaultParameter("index", int32, DomRegion.Empty));
}
property.Freeze();
l.Add(property);
} }
property.Freeze();
l.Add(property);
return l; return l;
} }

Loading…
Cancel
Save