From fcf73ad364cf10e5248ab97a4af61fb927451aad Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Fri, 3 Mar 2023 19:38:54 +0100 Subject: [PATCH] if model --- app/Console/Commands/Nostr/PublishUnpublishedItems.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/Nostr/PublishUnpublishedItems.php b/app/Console/Commands/Nostr/PublishUnpublishedItems.php index 77a1c975..7d56b693 100644 --- a/app/Console/Commands/Nostr/PublishUnpublishedItems.php +++ b/app/Console/Commands/Nostr/PublishUnpublishedItems.php @@ -37,6 +37,8 @@ class PublishUnpublishedItems extends Command ->when($modelName === 'LibraryItem', fn($q) => $q->where('type', '<>', 'markdown_article')) ->orderByDesc('created_at') ->first(); - $this->publishOnNostr($model, $this->getText($model)); + if ($model){ + $this->publishOnNostr($model, $this->getText($model)); + } } }