From 1881182cd9f4869cac01265e3195deba8206345c Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 28 Mar 2017 19:20:31 +0200 Subject: [PATCH] Bugfix when value is null (#155) --- Changelog.md | 6 ++++++ TaggablePSR6ItemAdapter.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 0f6d85e..73a420a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ## UNRELEASED +## 0.5.1 + +### Fixed + +* Bug on `TaggablePSR6ItemAdapter::isItemCreatedHere` where item value was `null`. + ## 0.5.0 ### Added diff --git a/TaggablePSR6ItemAdapter.php b/TaggablePSR6ItemAdapter.php index 48b06b9..9c5be90 100644 --- a/TaggablePSR6ItemAdapter.php +++ b/TaggablePSR6ItemAdapter.php @@ -230,6 +230,6 @@ private function initializeTags() */ private function isItemCreatedHere($rawItem) { - return is_array($rawItem) && isset($rawItem['value']) && isset($rawItem['tags']) && count($rawItem) === 2; + return is_array($rawItem) && array_key_exists('value', $rawItem) && array_key_exists('tags', $rawItem) && count($rawItem) === 2; } }