[hamster-applet] empty list in javascript still evaluates to True



commit 0059d5a83560be773bad49087771c015b4e1a2e6
Author: Toms BauÄis <toms baugis gmail com>
Date:   Thu Jul 7 11:05:42 2011 +0300

    empty list in javascript still evaluates to True

 src/shell_extension/extension.js |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/shell_extension/extension.js b/src/shell_extension/extension.js
index 8731273..9e33d28 100644
--- a/src/shell_extension/extension.js
+++ b/src/shell_extension/extension.js
@@ -51,7 +51,6 @@ function fromDbusFact(fact) {
 		let res = new Date(timestamp)
 		return new Date(res.setUTCMinutes(res.getUTCMinutes() + res.getTimezoneOffset()));
 	}
-	global.log(fact[1] + " ----- " + fact[2])
 
     return {
 		name: fact[4],
@@ -174,7 +173,7 @@ HamsterButton.prototype = {
 			this.facts = facts;
 
     	    let fact = null;
-    	    if (facts) {
+    	    if (facts.length) {
     	        fact = fromDbusFact(facts[facts.length - 1]);
     	    }
 



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