diff --git a/js/options/user-css.js b/js/options/user-css.js
index 612a9d48..45376fe0 100644
--- a/js/options/user-css.js
+++ b/js/options/user-css.js
@@ -29,6 +29,9 @@ var submit = $("").css({
onready(function(){
var stylechooser = $("").appendTo(tab.content);
+ // Handle empty localStorage
+ if (!localStorage.stylesheets_all_boards) localStorage.stylesheets_all_boards = "false";
+ if (!localStorage.board_stylesheets) localStorage.board_stylesheets = '{}';
var fix_choice = function(){
stylechooser.empty();
@@ -48,8 +51,6 @@ onready(function(){
var allboards = $("").appendTo(tab.content).find('input');
- // Handle empty localStorage
- if (!localStorage.stylesheets_all_boards) localStorage.stylesheets_all_boards = "false";
if (localStorage.stylesheets_all_boards === "true") allboards.prop('checked', 'checked');
allboards.on('change', function(e) {
@@ -106,7 +107,7 @@ var apply_css = function() {
ls.after($("")
.attr("class", "user-chosen-stylesheet")
.attr("id", "stylesheet")
- .attr("href", configRoot+to_apply)
+ .attr("href", (configRoot !== '/' ? configRoot : '')+to_apply)
);
}
return to_apply;