Author: rolf
Date: 2007-09-27 13:33:10 -0400 (Thu, 27 Sep 2007)
New Revision: 86521
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/animation.cpp
Log:
* src/animation.cpp: Add a few null checks.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-09-27 17:33:09 UTC (rev 86520)
+++ trunk/moon/src/ChangeLog 2007-09-27 17:33:10 UTC (rev 86521)
@@ -1,3 +1,7 @@
+2007-09-27 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * animation.cpp: Add a few null checks.
+
2007-09-27 Larry Ewing <[EMAIL PROTECTED]>
* media.cpp: Don't mark our download progress as 100% until we've
Modified: trunk/moon/src/animation.cpp
===================================================================
--- trunk/moon/src/animation.cpp 2007-09-27 17:33:09 UTC (rev 86520)
+++ trunk/moon/src/animation.cpp 2007-09-27 17:33:10 UTC (rev 86521)
@@ -52,7 +52,11 @@
AnimationStorage::UpdatePropertyValue ()
{
Value *current_value = clock->GetCurrentValue (baseValue, NULL/*XXX*/);
- targetobj->SetValue (targetprop, *current_value);
+ if (current_value != NULL)
+ targetobj->SetValue (targetprop, *current_value);
+ //else
+ // targetobj->SetValue (targetprop, NULL);
+
delete current_value;
}
@@ -1124,14 +1128,16 @@
KeyTime *kt;
/* if the last frame is KeyTime Uniform or Paced, resolve it
to be equal to the total interpolation time */
- keyframe = (KeyFrame *) ((Collection::Node *) col->list->Last ())->obj;
- kt = keyframe->GetKeyTime ();
- if (*kt == KeyTime::Paced || *kt == KeyTime::Uniform) {
- keyframe->resolved_keytime = total_interpolation_time;
- keyframe->resolved = true;
+ cur = col->list->Last ();
+ if (cur) {
+ keyframe = (KeyFrame *) ((Collection::Node *) cur)->obj;
+ kt = keyframe->GetKeyTime ();
+ if (*kt == KeyTime::Paced || *kt == KeyTime::Uniform) {
+ keyframe->resolved_keytime = total_interpolation_time;
+ keyframe->resolved = true;
+ }
}
-
/* if the first frame is KeyTime::Paced:
** 1. if there is only 1 frame, its KeyTime is the total
interpolation time.
** 2. if there is more than 1 frame, its KeyTime is 0.
@@ -1139,14 +1145,17 @@
** note 1 is handled in the above block so we only have to
** handle 2 here.
*/
- keyframe = (KeyFrame *) ((Collection::Node *) col->list->First ())->obj;
- kt = keyframe->GetKeyTime ();
+ cur = (Collection::Node*) col->list->First ();
+ if (cur) {
+ keyframe = (KeyFrame *) ((Collection::Node*) cur)->obj;
+ kt = keyframe->GetKeyTime ();
- if (!keyframe->resolved && *kt == KeyTime::Paced) {
- keyframe->resolved_keytime = 0;
- keyframe->resolved = true;
+ if (!keyframe->resolved && *kt == KeyTime::Paced) {
+ keyframe->resolved_keytime = 0;
+ keyframe->resolved = true;
+ }
}
-
+
/* XXX resolve remaining KeyTime::Uniform frames (step 5 from url) */
/* XXX resolve frames with unspecified keytimes (step 6 from url)
@@ -1236,7 +1245,7 @@
current_keyframe = (DoubleKeyFrame*)key_frames->GetKeyFrameForTime
(current_time, (KeyFrame**)keyframep);
if (current_keyframe == NULL) {
- abort ();
+ //abort ();
return NULL; /* XXX */
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches