Add null check for some UI components.

This commit is contained in:
2023-11-10 14:50:15 +08:00
parent a19a3d9b81
commit adf5019e2a
2 changed files with 6 additions and 4 deletions

View File

@@ -15,7 +15,9 @@ namespace Cryville.Crtr {
static Color _tickColor2 = new Color(1, 1, 1, .8f);
static Color _suspendedColor = new Color(1, 0, 0, 1);
void Update() {
switch (Game.NetworkTaskWorker.TickBackgroundTasks()) {
var status = Game.NetworkTaskWorker.TickBackgroundTasks();
if (_image == null) return;
switch (status) {
case WorkerStatus.Idle:
_image.color = _idleColor;
timer = 0f;