[CSharpBinding] Fixed bug that could cause that the state tracker works on invalid editor states.