Tried to use invalid object (type Panel) (Object was NULL or not of the right type)

Whenever I try to close the phoneBody DFrame, I get this error:



[ERROR] addons/plex/lua/darkrp_modules/cellphone/cl_init.lua:79: Tried to use invalid object (type Panel) (Object was NULL or not of the right type)
  1. GetWide - [C]:-1
   2. unknown - addons/plex/lua/darkrp_modules/cellphone/cl_init.lua:79


This is the line it complains about:



		phoneBody.Paint = function ()
			draw.RoundedBox(10, 0, 0, phoneBody:GetWide(), phoneBody:GetTall(), Color(60,60,60,255))
			draw.RoundedBox(6, phoneBody:GetWide() /2 - 50, 20, 100, 15, Color(20,20,20,255))
			draw.RoundedBox(4, 22, 50, phoneBody:GetWide() - 40, phoneBody:GetTall() - 90, Color(160,160,160,255))


I close it by simply: phoneBody:Close()

phoneBody:SetDeleteOnClose(false)

That doesn’t look like 1 line to me.