[gnome-shell] animations: Guard against empty animations



commit e5101eb4072c3445ea2f029cc1abf774316351db
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Nov 21 18:09:42 2016 +0100

    animations: Guard against empty animations
    
    Our animation code not only relies on the animation being loaded
    (which we handle), but also on having at least one frame - otherwise
    the computation of the next frame index will turn up NaN through
    division by zero. Guard against this case by treating empty animations
    as not loaded.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774805

 js/ui/animation.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/animation.js b/js/ui/animation.js
index 23ec934..1ae9ba0 100644
--- a/js/ui/animation.js
+++ b/js/ui/animation.js
@@ -67,7 +67,7 @@ const Animation = new Lang.Class({
     },
 
     _animationsLoaded: function() {
-        this._isLoaded = true;
+        this._isLoaded = this._animations.get_n_children() > 0;
 
         if (this._isPlaying)
             this.play();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]