mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-12-20 02:11:23 +00:00
Fix: Only access slice if it has content
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
159edd485e
commit
b5d908d2e2
1 changed files with 4 additions and 1 deletions
|
@ -120,7 +120,10 @@ func (m modStreamSchedule) cronUpdateSchedule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if managedMsg != nil {
|
if managedMsg != nil {
|
||||||
oldEmbed := managedMsg.Embeds[0]
|
var oldEmbed *discordgo.MessageEmbed
|
||||||
|
if len(managedMsg.Embeds) > 0 {
|
||||||
|
oldEmbed = managedMsg.Embeds[0]
|
||||||
|
}
|
||||||
|
|
||||||
if isDiscordMessageEmbedEqual(oldEmbed, msgEmbed) && strings.TrimSpace(managedMsg.Content) == strings.TrimSpace(contentString) {
|
if isDiscordMessageEmbedEqual(oldEmbed, msgEmbed) && strings.TrimSpace(managedMsg.Content) == strings.TrimSpace(contentString) {
|
||||||
log.Debug("Stream Schedule is up-to-date")
|
log.Debug("Stream Schedule is up-to-date")
|
||||||
|
|
Loading…
Reference in a new issue