]> git.localhorst.tv Git - alttp.git/commitdiff
do not override associated channel
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 9 Apr 2024 10:22:29 +0000 (12:22 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 9 Apr 2024 10:22:29 +0000 (12:22 +0200)
app/Models/ChatLog.php

index d5fc76d9325c565b803ec16eaa92c465366822ac..c28a0724685320254e122e3e727a5755a56134b6 100644 (file)
@@ -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() {