From bfc45b40d539431e465210e3ecf11367a42626ee Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 9 Apr 2024 12:22:29 +0200 Subject: [PATCH] do not override associated channel --- app/Models/ChatLog.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/ChatLog.php b/app/Models/ChatLog.php index d5fc76d..c28a072 100644 --- a/app/Models/ChatLog.php +++ b/app/Models/ChatLog.php @@ -97,7 +97,6 @@ class ChatLog extends Model { protected function evaluateChannel() { if (empty($this->params)) { - $this->channel()->associate(null); return; } $cname = $this->params[0]; @@ -105,7 +104,9 @@ class ChatLog extends Model { $cname = '#'.$cname; } $channel = Channel::firstWhere('twitch_chat', '=', $cname); - $this->channel()->associate($channel); + if (!is_null($channel)) { + $this->channel()->associate($channel); + } } protected function detectLanguage() { -- 2.39.2