Lua draw error

I was thinking i fix the error but i dident so sorry!


[ERROR] gamemodes/underdone/entities/entities/underdone_billboard/cl_init.lua:34: Tried to use invalid object (type Panel) (Object was NULL or not of the right type)
  1. GetHTMLMaterial - [C]:-1
   2. unknown - gamemodes/underdone/entities/entities/underdone_billboard/cl_init.lua:34

Just verify that self.Panel is valid before you do any calling on it


function ENT:Draw()
	if ( IsValid( self.Panel ) ) then html_mat = self.Panel:GetHTMLMaterial() end
	self:DrawModel()
	local pos = self:GetPos()

like that?