Browse Source

fix bilibili danmaku color parse error

DIYgod 8 years ago
parent
commit
7b0e21915d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      nodejs/routes/bilibili.js

+ 1 - 1
nodejs/routes/bilibili.js

@@ -15,7 +15,7 @@ module.exports = function (req, res) {
     var cid = query.cid;
     var cid = query.cid;
 
 
     function addZero(str, length){
     function addZero(str, length){
-        return new Array(length - str.length + 1).join("0") + str;
+        return new Array(Math.max(length - str.length + 1, 0)).join("0") + str;
     }
     }
 
 
     if (cid) {
     if (cid) {