From b36eada764601355be4616fb92822ffabdcb1dc8 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sun, 22 May 2022 16:31:21 +0200 Subject: fixes for lint issues --- lib/JWebmail/Plugin/ServerSideSessionData.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/JWebmail/Plugin/ServerSideSessionData.pm') diff --git a/lib/JWebmail/Plugin/ServerSideSessionData.pm b/lib/JWebmail/Plugin/ServerSideSessionData.pm index 40772eb..94e8f25 100644 --- a/lib/JWebmail/Plugin/ServerSideSessionData.pm +++ b/lib/JWebmail/Plugin/ServerSideSessionData.pm @@ -120,10 +120,9 @@ sub s3d { $c->session(S_KEY, $file->basename); } - my $data = decode_json($file->slurp) if (-s $file); + my $data = -s $file ? decode_json($file->slurp) : {}; if (defined $val) { # set - $data = ref $data ? $data : {}; $data->{$key} = $val; $file->spurt(encode_json $data, "\n"); -- cgit v1.2.3