浏览代码

don't set undefined = null in cache.get_details; #101

jomo 10 年之前
父节点
当前提交
5e4a6d5bbe
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      modules/cache.js

+ 4 - 4
modules/cache.js

@@ -143,7 +143,7 @@ exp.remove_hash = function(rid, userId) {
 
 
 // get a details object for +userId+
 // get a details object for +userId+
 // {skin: "0123456789abcdef", cape: "gs1gds1g5d1g5ds1", time: 1414881524512}
 // {skin: "0123456789abcdef", cape: "gs1gds1g5d1g5ds1", time: 1414881524512}
-// +callbacl+ contains error, details
+// +callback+ contains error, details
 // details is null when userId not cached
 // details is null when userId not cached
 exp.get_details = function(userId, callback) {
 exp.get_details = function(userId, callback) {
   // get userId in lower case if not null
   // get userId in lower case if not null
@@ -152,8 +152,8 @@ exp.get_details = function(userId, callback) {
     var details = null;
     var details = null;
     if (data) {
     if (data) {
       details = {
       details = {
-        skin: (!data.s || data.s === "") ? null : data.s,
-        cape: (!data.c || data.c === "") ? null : data.c,
+        skin: data.s === "" ? null : data.s,
+        cape: data.c === "" ? null : data.c,
         time: Number(data.t)
         time: Number(data.t)
       };
       };
     }
     }
@@ -162,4 +162,4 @@ exp.get_details = function(userId, callback) {
 };
 };
 
 
 connect_redis();
 connect_redis();
-module.exports = exp;
+module.exports = exp;