Prevent internal server error if no description passed to API (sync with sciyoshi/redmine-slack commit 5e01d86a12448554ee7015a1ee9df3638bbd7610)

This commit is contained in:
Thanos Kyritsis
2016-11-08 14:42:21 +02:00
parent c092d8bfcc
commit bc9f5df3fc

View File

@@ -268,6 +268,10 @@ private
end
def extract_usernames text = ''
if text.nil?
text = ''
end
# mattermost usernames may only contain lowercase letters, numbers,
# dashes and underscores and must start with a letter or number.
text.scan(/@[a-z0-9][a-z0-9_\-]*/).uniq