From 8d300a2aec9b4ed759fb0dff6d661f205e5c2979 Mon Sep 17 00:00:00 2001 From: Yunusov_Niyaz Date: Wed, 11 Oct 2023 20:42:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Trolleybus/Trolleybus/DrawingTrolleybus.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Trolleybus/Trolleybus/DrawingTrolleybus.cs b/Trolleybus/Trolleybus/DrawingTrolleybus.cs index be9fcce..504ea31 100644 --- a/Trolleybus/Trolleybus/DrawingTrolleybus.cs +++ b/Trolleybus/Trolleybus/DrawingTrolleybus.cs @@ -53,6 +53,10 @@ namespace Trolleybus } public void SetPosition(int x, int y) { + if (EntityTrolleybus == null) + { + return; + } if (x < 0 || y < 0 || x + _trolleybusWidth >= _pictureWidth || y + _trolleybusHeight >= _pictureHeight) x = y = 10; _startPosX = x;