Fix exception state being "sticky"

This commit is contained in:
Sinai
2022-04-11 17:37:03 +10:00
parent 4af86e0e25
commit 62fa7f30f3
2 changed files with 35 additions and 19 deletions

View File

@ -28,7 +28,23 @@ namespace UnityExplorer.Tests
public static object LiterallyAnything = null;
public static string Exception => throw new Exception("This is a test.");
public static string Exception
{
get
{
if (!shouldThrow)
{
shouldThrow = true;
throw new Exception("This is a test.");
}
else
{
shouldThrow = false;
return "No exception";
}
}
}
static bool shouldThrow;
// Test enumerables
public static int[,,] MultiDimensionalArray = new int[45, 45, 45];