Skip to content

Commit 3c9fab4

Browse files
committed
Fixed exception with dump command when unknown data is encountered
1 parent a3bff47 commit 3c9fab4

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

UnityFileSystem/TypeTreeNode.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,26 @@ Type GetCSharpType()
168168
return typeof(string);
169169

170170
default:
171-
//if (!IsLeaf)
171+
{
172+
if (Size == 8)
173+
{
174+
return typeof(long);
175+
}
176+
else if (Size == 4)
177+
{
178+
return typeof(int);
179+
}
180+
else if (Size == 2)
181+
{
182+
return typeof(short);
183+
}
184+
else if (Size == 1)
185+
{
186+
return typeof(sbyte);
187+
}
188+
172189
return typeof(object);
173-
//break;
190+
}
174191
}
175192

176193
throw new Exception($"Unknown type {Type}");

0 commit comments

Comments
 (0)