From 18d76a597f4aa553162a65852b9bfab7433e3f80 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 19 Oct 2014 12:54:02 +0200 Subject: [PATCH] Small cleanup in create_etherpad_session helper --- vroom.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vroom.pl b/vroom.pl index f6aafee..079da4c 100755 --- a/vroom.pl +++ b/vroom.pl @@ -795,9 +795,10 @@ helper create_pad => sub { helper create_etherpad_session => sub { my $self = shift; my ($room) = @_; - return undef unless ($ec); my $data = $self->get_room_by_name($room); - return undef unless ($data && $data->{etherpad_group}); + if (!$ec || !$data || !$data->{etherpad_group}){ + return 0; + } my $id = $ec->create_author_if_not_exists_for($self->session('name')); $self->session($room)->{etherpadAuthorId} = $id; my $etherpadSession = $ec->create_session($data->{etherpad_group}, $id, time + 86400); @@ -807,6 +808,7 @@ helper create_etherpad_session => sub { $etherpadCookieParam->{domain} = $config->{'etherpad.base_domain'}; } $self->cookie(sessionID => $etherpadSession, $etherpadCookieParam); + return 1; }; # Route / to the index page