Skip to content

Commit e469f21

Browse files
committed
Warn when property not found
1 parent cfc5d3d commit e469f21

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/PropertyAnimator.vala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ public class Gala.PropertyAnimator : Object {
3333
return;
3434
}
3535

36+
var attached_to_stopped = false;
3637
for (var i = 0; i < properties.length; i++) {
3738
var property = properties[i];
3839

40+
if (actor.find_property (property.property) == null) {
41+
warning ("PropertyAnimator: Can't find property '%s'", property.property);
42+
continue;
43+
}
44+
3945
Value actor_current_property = {};
4046
actor.get_property (property.property, ref actor_current_property);
4147

@@ -50,8 +56,9 @@ public class Gala.PropertyAnimator : Object {
5056
)
5157
};
5258

53-
if (i == 0) {
59+
if (!attached_to_stopped) {
5460
transition.stopped.connect (call_on_stopped);
61+
attached_to_stopped = true;
5562
}
5663

5764
actor.add_transition (property.property, transition);

vapi/mutter-clutter.vapi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7694,7 +7694,7 @@ namespace Clutter {
76947694
}
76957695
[CCode (cheader_filename = "clutter/clutter.h", type_cname = "ClutterAnimatableInterface", type_id = "clutter_animatable_get_type ()")]
76967696
public interface Animatable : GLib.Object {
7697-
public abstract unowned GLib.ParamSpec find_property (string property_name);
7697+
public abstract unowned GLib.ParamSpec? find_property (string property_name);
76987698
public abstract unowned Clutter.Actor get_actor ();
76997699
public abstract void get_initial_state (string property_name, GLib.Value value);
77007700
public abstract bool interpolate_value (string property_name, Clutter.Interval interval, double progress, out GLib.Value value);

0 commit comments

Comments
 (0)