Skip to content

Commit 725a184

Browse files
author
Jay
committed
add_animator() enforces need to specify target element
1 parent 9820d1b commit 725a184

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/engine.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,6 +3230,10 @@ pub const Display = struct {
32303230
/// Add an animator that points to a currently active/valid element.
32313231
/// The element must not be destroyed for the lifetime of the animation.
32323232
pub inline fn add_animator(self: *Display, animator: Animator) error{OutOfMemory}!void {
3233+
if (animator.target == null) {
3234+
err("add_animator called with without target", .{});
3235+
return;
3236+
}
32333237
var new_animator = try self.allocator.create(Animator);
32343238
new_animator.* = animator;
32353239
new_animator.setup = false;

0 commit comments

Comments
 (0)