From ac5336fbc5fb8038de541dd06938a8beb2e8d733 Mon Sep 17 00:00:00 2001
From: Yassine Doghri <yassine@doghri.fr>
Date: Tue, 26 Dec 2023 15:52:46 +0000
Subject: [PATCH] fix(import): check for empty string when generating podcast
 guid for feeds not including one

---
 app/Models/PodcastModel.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/Models/PodcastModel.php b/app/Models/PodcastModel.php
index 40e947204f..719bff32a3 100644
--- a/app/Models/PodcastModel.php
+++ b/app/Models/PodcastModel.php
@@ -502,7 +502,10 @@ class PodcastModel extends Model
      */
     protected function setPodcastGUID(array $data): array
     {
-        if (! array_key_exists('guid', $data['data']) || $data['data']['guid'] === null) {
+        if (! array_key_exists(
+            'guid',
+            $data['data']
+        ) || $data['data']['guid'] === null || $data['data']['guid'] === '') {
             $uuid = service('uuid');
             $feedUrl = url_to('podcast-rss-feed', $data['data']['handle']);
             // 'ead4c236-bf58-58c6-a2c6-a6b28d128cb6' is the uuid of the podcast namespace
-- 
GitLab