Prevent internal server error if empty custom field for channel (refs #17)

This commit is contained in:
Thanos Kyritsis
2017-01-26 13:47:21 +02:00
parent 5171908a19
commit 24268e2297
2 changed files with 7 additions and 2 deletions

View File

@@ -24,7 +24,11 @@ from the plugin directory.
Restart Redmine, and you should see the plugin show up in the Plugins page.
Under the configuration options, set the Mattermost API URL to the URL for an
Incoming WebHook integration in your Mattermost account (see also the next two sections).
Incoming WebHook integration in your Mattermost account and also set the Mattermost
Channel to the channel's handle (be careful, this is not the channel's display name
visible to users, you can find each channel's handle by navigating inside the channel
and clicking the down-arrow and selecting view info). See also the next two sections
for advanced and custom routing options.
## Customized Routing

View File

@@ -202,7 +202,8 @@ private
Setting.plugin_redmine_mattermost[:channel],
].find{|v| v.present?}
# Channel name '-' is reserved for NOT notifying
# Channel name '-' or empty '' is reserved for NOT notifying
return [] if val.to_s == ''
return [] if val.to_s == '-'
val.split(",")
end