diff --git a/lib/cyberman.pm b/lib/cyberman.pm index 2a69c46..6c7b274 100644 --- a/lib/cyberman.pm +++ b/lib/cyberman.pm @@ -55,7 +55,7 @@ hook 'before' => sub { var email => $user->{"email"}; var config => config(); - if (grep {$_ eq $user->{"stylesheet"}} @{ config->{"stylesheets"}->{"available"} }) { + if ($user->{"stylesheet"} && grep {$_ eq $user->{"stylesheet"}} @{ config->{"stylesheets"}->{"available"} }) { var stylesheet => $user->{"stylesheet"}; } else { var stylesheet => config->{"stylesheets"}->{"default"}; diff --git a/lib/cyberman/Account.pm b/lib/cyberman/Account.pm index e07c0ed..1f05f46 100644 --- a/lib/cyberman/Account.pm +++ b/lib/cyberman/Account.pm @@ -144,6 +144,9 @@ post '/account' => sub { ); # Instant stylesheet update + if (!$user->{"stylesheet"}) { + $user->{"stylesheet"} = 0; + } if ($user->{"stylesheet"} ne $newuser->{"stylesheet"}) { return template 'redir' => { "redir" => "account?updated=1",