handle deleted users (null author)

This commit is contained in:
Thomas Rubini 2023-01-25 22:54:06 +01:00
parent dc9465495a
commit ececccc3a0
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -35,7 +35,14 @@ $O_recipe = $A_view["RECIPE"];
</ol>
</section>
<p>By <?= $O_recipe->getAuthor()->S_USERNAME ?></p>
<?php
$O_author = $O_recipe->getAuthor();
if($O_author === null) {
echo '<p>By an anonymous user</p>';
} else {
echo '<p>By '.$O_author->S_USERNAME.' </p>';
}
?>
<?php
View::show("appreciations/view_all", $A_view)