From 7b0e21915da8f5ce59fcd55b855d3d93f78bf17c Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 5 Dec 2016 01:14:51 +0800 Subject: [PATCH] fix bilibili danmaku color parse error --- nodejs/routes/bilibili.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/routes/bilibili.js b/nodejs/routes/bilibili.js index cf147d5..0484570 100644 --- a/nodejs/routes/bilibili.js +++ b/nodejs/routes/bilibili.js @@ -15,7 +15,7 @@ module.exports = function (req, res) { var cid = query.cid; 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) {