You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If TransformControls is created without domElement parameter, which is marked as optional, and then dispose() method is called, "this.domElement is null" error occurs and crashes the application.
Reproduction steps
create TransformControls without the domElement parameter
call dispose() method
Quickest way to see this is to change examples/misc_controls_transform.html line
Calling connect() without a valid domElement is actually an error and should not silently fail.
Since calling disconnect() without a previous connect() is also an error situation, I think it's not right to implement the early out. I would rather suggest to throw exceptions in this case. We should not support operations that make no sense.
Given the policy that the engines usually does not validate user input, there is not necessarily a need for a change. The existing runtime error should make the error situation already clear.
Description
If TransformControls is created without
domElement
parameter, which is marked as optional, and thendispose()
method is called, "this.domElement is null" error occurs and crashes the application.Reproduction steps
Quickest way to see this is to change
examples/misc_controls_transform.html
lineto
and reload page, Dev Tools console will show the "this.domElement is null" error inside the
dispose()
method.The solution to this is to check for
this.domElement
in bothconnect()
anddisconnect()
methods like so:and remove the
check in constructor which only guards call to
connect()
.Code
Live example
Screenshots
No response
Version
0.170.0
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: