From bc2b947cd54e49a03c267f3c0f13dc5b8a04d962 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 16 Mar 2016 22:47:12 +0100 Subject: [PATCH] add check --- .../ApiBundle/Controller/WallabagRestController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index a590dda1..744e1a60 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -126,9 +126,13 @@ class WallabagRestController extends FOSRestController $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags); } - $entry->setStarred((bool) $isStarred); + if (!is_null($isStarred)) { + $entry->setStarred((bool) $isStarred); + } - $entry->setArchived((bool) $isArchived); + if (!is_null($isArchived)) { + $entry->setArchived((bool) $isArchived); + } $em = $this->getDoctrine()->getManager(); $em->persist($entry); -- 2.41.0