Skip to content

Commit f0cbe7c

Browse files
author
hannsen
authored
check if nav_bar was found
1 parent 96efca5 commit f0cbe7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Rutorrent GetMulitpleTorrents.user.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// @description gets multiple torrents which you select in rutorrent
66
// @include http://*ruTorrent*
77
// @include https://*ruTorrent*
8-
// @version 2.8
8+
// @version 2.9
99
// @grant none
1010
// @downloadURL https://github.com/hannsen/userscripts/raw/master/Rutorrent%20GetMulitpleTorrents.user.js
1111
// @updateURL https://github.com/hannsen/userscripts/raw/master/Rutorrent%20GetMulitpleTorrents.user.js
@@ -21,10 +21,10 @@ unfoldLink.id = 'grab';
2121
unfoldLink.title = 'Download selected torrent files';
2222
unfoldLink.href = 'javascript:void(0)';
2323

24-
nav_bar.appendChild(unfoldLink);
25-
26-
document.getElementById('grab').addEventListener('click', getTorrents, false);
27-
24+
if(nav_bar){
25+
nav_bar.appendChild(unfoldLink);
26+
document.getElementById('grab').addEventListener('click', getTorrents, false);
27+
}
2828

2929
function getTorrents(){
3030
var selected = document.getElementsByClassName("selected");

0 commit comments

Comments
 (0)