FashGek / hotween

Automatically exported from code.google.com/p/hotween
0 stars 0 forks source link

NullReferenceException in HOTweener.cs, line 1199 #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Within an OnUpdate event on a non-GameObject (Not sure about on a GameObject, 
haven't tested that yet), calling "data.tween.Kill();" to prematurely stop a 
tween results in this NullReferenceException.

What version of the product are you using? On what operating system?
HEAD

Please provide any additional information below.
Amending HOTween.cs line 1199 within the 'Clear()' function to read as below 
fixed the exception:

Original:
it.StopAllCoroutines();

Fixed:
if(it != null)  it.StopAllCoroutines();

Notes:
I've just started playing with HOTween a few hours ago, not sure what exactly 
this member being nulled unexpectedly may indicate in the context of the 
broader design/architecture of HOTween, but this small change at least fixes 
the immediate exception.

Original issue reported on code.google.com by jstri...@fkomedia.com on 22 Feb 2012 at 11:07

GoogleCodeExporter commented 9 years ago
Thanks for getting this error and solving it.
I added the change you made to the newest build (v8.0.102), though I didn't 
manage to replicate the error with the previous version. Would you be able to 
send me an example of how it happened to you so I can check it more thoroughly? 
Only if you have the time, obviously :)

Original comment by daniele....@gmail.com on 22 Feb 2012 at 11:41