Skip to content

Commit 001e8c4

Browse files
committed
Small bugfix
Forgot to add a check - if it has a parent or not
1 parent 18601d5 commit 001e8c4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Basalt/Object.lua

+8-6
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,14 @@ return function(name)
588588
self:registerEvent("mouse_drag", v)
589589
end
590590
end
591-
self.parent:addEvent("mouse_drag", self)
592-
activeEvents["mouse_drag"] = true
593-
self.parent:addEvent("mouse_click", self)
594-
activeEvents["mouse_click"] = true
595-
self.parent:addEvent("mouse_up", self)
596-
activeEvents["mouse_up"] = true
591+
if(self.parent~=nil)then
592+
self.parent:addEvent("mouse_drag", self)
593+
activeEvents["mouse_drag"] = true
594+
self.parent:addEvent("mouse_click", self)
595+
activeEvents["mouse_click"] = true
596+
self.parent:addEvent("mouse_up", self)
597+
activeEvents["mouse_up"] = true
598+
end
597599
return self
598600
end;
599601

0 commit comments

Comments
 (0)