From 50a4133ae4f485718336bd932b4c4d0ff856e138 Mon Sep 17 00:00:00 2001
From: Jordach <jordach@wolfo.tech>
Date: Wed, 22 Dec 2021 02:56:55 +0000
Subject: [PATCH] Fix Issue #1

---
 mods/invector/ai.lua | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/mods/invector/ai.lua b/mods/invector/ai.lua
index 924ee3f..4165d0a 100644
--- a/mods/invector/ai.lua
+++ b/mods/invector/ai.lua
@@ -222,12 +222,15 @@ function invector.ai.think(self)
 			controls.up = false
 			controls.down = true
 			controls.jump = false
-			if cross.y > 0 then
-				controls.left = false
-				controls.right = true
-			elseif cross.y < 0 then
-				controls.right = false
-				controls.left = true
+			if cross == nil then
+			else
+				if cross.y > 0 then
+					controls.left = false
+					controls.right = true
+				elseif cross.y < 0 then
+					controls.right = false
+					controls.left = true
+				end
 			end
 		end