Skip to content

Commit 0c2bfaf

Browse files
committed
VM: Yet more enum fixes
1 parent d819260 commit 0c2bfaf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Phantasma.VM/VMObject.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,18 @@ public void SerializeData(BinaryWriter writer)
13141314
}
13151315

13161316
case VMType.Enum:
1317-
var temp1 = (Enum)this.Data;
1318-
var temp2 = uint.Parse(temp1.ToString("d"));
1317+
uint temp2;
1318+
1319+
if (this.Data is Enum)
1320+
{
1321+
var temp1 = (Enum)this.Data;
1322+
temp2 = uint.Parse(temp1.ToString("d"));
1323+
}
1324+
else
1325+
{
1326+
temp2 = (uint)this.Data;
1327+
}
1328+
13191329
writer.WriteVarInt(temp2);
13201330
break;
13211331

0 commit comments

Comments
 (0)