[gnome-shell] messageTray.js: raise an exception only if parseInt(count) returns NaN



commit 6cb707cc4fa391f0f64710cc223e514a9b05ac5f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Jul 7 15:35:37 2011 +0200

    messageTray.js: raise an exception only if parseInt(count) returns NaN
    
    0 is a valid value for count so we should accept it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654139

 js/ui/messageTray.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index a29dede..bd55a31 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -941,7 +941,7 @@ Source.prototype = {
     },
 
     _setCount: function(count, visible) {
-        if (!parseInt(count))
+        if (isNaN(parseInt(count)))
             throw new Error("Invalid notification count: " + count);
 
         this._counterBin.visible = visible;



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