diff options
author | ebith | 2011-11-07 16:19:33 +0900 |
---|---|---|
committer | ebith | 2011-11-07 16:19:33 +0900 |
commit | 775926b1b29140d663e4e24ae8c25362f5def21b (patch) | |
tree | c582e004357cd5261d545b07f804bc0594f82548 | |
parent | 4b2d7f14ffa62b0739594d04f40ba2028049f178 (diff) | |
download | vimperator-plugins-775926b1b29140d663e4e24ae8c25362f5def21b.tar.bz2 |
マイリストコメントにundefinedつけまくってしまうバグ直した
-rw-r--r-- | nicolist.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nicolist.js b/nicolist.js index b6be7dc..854a869 100644 --- a/nicolist.js +++ b/nicolist.js @@ -46,9 +46,11 @@ commands.addUserCommand( 'マイリストに追加する', function (args) { let video_id = content.window.wrappedJSObject.video_id; - if (!video_id) + if (!video_id) { return liberator.echoerr('nicolist : watchページじゃない!'); + } let [mylist_id, description] = args; + if (!description){ description = ''; } //undefinedが入っているとそれをマイリストコメントにしてしまうので。 let token = content.window.wrappedJSObject.so.variables.csrfToken; let url = 'http://www.nicovideo.jp/api/mylist/add?group_id=' + mylist_id + '&token=' + token + '&item_id=' + video_id + '&description=' + description; liberator.echo('nicolist add : ' + JSON.parse(util.httpGet(url).responseText).status); |