[respond] Fix: Empty string fallback should not count as fallback
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c1e84f31e8
commit
797b7719f0
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ type actor struct{}
|
||||||
func (a actor) Execute(c *irc.Client, m *irc.Message, r *plugins.Rule, eventData plugins.FieldCollection, attrs plugins.FieldCollection) (preventCooldown bool, err error) {
|
func (a actor) Execute(c *irc.Client, m *irc.Message, r *plugins.Rule, eventData plugins.FieldCollection, attrs plugins.FieldCollection) (preventCooldown bool, err error) {
|
||||||
msg, err := formatMessage(attrs.MustString("message", nil), m, r, eventData)
|
msg, err := formatMessage(attrs.MustString("message", nil), m, r, eventData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !attrs.CanString("fallback") {
|
if !attrs.CanString("fallback") || attrs.MustString("fallback", nil) == "" {
|
||||||
return false, errors.Wrap(err, "preparing response")
|
return false, errors.Wrap(err, "preparing response")
|
||||||
}
|
}
|
||||||
if msg, err = formatMessage(attrs.MustString("fallback", nil), m, r, eventData); err != nil {
|
if msg, err = formatMessage(attrs.MustString("fallback", nil), m, r, eventData); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue