summaryrefslogtreecommitdiff
path: root/lib/mattermost/session.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2016-12-15 21:06:17 +0100
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-12-17 10:31:14 +0100
commit9bcc4d4de5510a14ae891105645b4d59891ba78d (patch)
treec43c18c576d6250af5217516ee5935b4a389f2bd /lib/mattermost/session.rb
parenta31cdb29e49b62f0227963cbc54b6564a3ee9da8 (diff)
downloadgitlab-ce-9bcc4d4de5510a14ae891105645b4d59891ba78d.tar.gz
Ensure the session is destroyed
Diffstat (limited to 'lib/mattermost/session.rb')
-rw-r--r--lib/mattermost/session.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mattermost/session.rb b/lib/mattermost/session.rb
index d14121c91a0..f4629585da7 100644
--- a/lib/mattermost/session.rb
+++ b/lib/mattermost/session.rb
@@ -28,10 +28,12 @@ module Mattermost
def with_session
raise NoSessionError unless create
- result = yield
- destroy
- result
+ begin
+ yield
+ ensure
+ destroy
+ end
end
# Next methods are needed for Doorkeeper