diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Array.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Array.cs
index e5e38075c7..1df900c20a 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Array.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Values/Value.Array.cs
@@ -31,8 +31,10 @@ namespace Debugger
/// Gets the number of elements in the array.
/// eg new object[4,5] returns 20
///
+ /// 0 for non-arrays
public int ArrayLength {
get {
+ if (!this.Type.IsArray) return 0;
return (int)CorArrayValue.Count;
}
}
@@ -41,15 +43,19 @@ namespace Debugger
/// Gets the number of dimensions of the array.
/// eg new object[4,5] returns 2
///
+ /// 0 for non-arrays
public int ArrayRank {
get {
+ if (!this.Type.IsArray) return 0;
return (int)CorArrayValue.Rank;
}
}
/// Gets the dimensions of the array
+ /// null for non-arrays
public ArrayDimensions ArrayDimensions {
get {
+ if (!this.Type.IsArray) return null;
int rank = this.ArrayRank;
uint[] baseIndicies;
if (CorArrayValue.HasBaseIndicies() == 1) {
diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs
index 0d087ea473..39c0473600 100644
--- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/ArrayValue.cs
@@ -69,9 +69,6 @@ namespace Debugger.Tests {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Break FunctionVariablesLifetime.cs:25,4-25,40
<_x0040_class>
Break FunctionVariablesLifetime.cs:34,4-34,40
<_x0040_class>
Break FunctionVariablesLifetime.cs:27,4-27,40
<_x0040_class>
Break FunctionVariablesLifetime.cs:34,4-34,40
<_x0040_class>
Break FunctionVariablesLifetime.cs:19,4-19,40
<_x0040_class>
Break GenericDictionary.cs:21,4-21,40
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Break Generics.cs:28,4-28,40
Break ObjectValue.cs:32,4-32,40
-
-
-
-
-
Break ObjectValue.cs:34,4-34,40
-
-
-
-
-
-
-
-