From 92e348db89c8362947e2efb8df9ba819cea428f2 Mon Sep 17 00:00:00 2001 From: David Cova Date: Thu, 10 Aug 2023 17:18:24 +0100 Subject: [PATCH] Fix: Allow isPublishMessageWithNullCharacter to receive messages as null (#162) --- src/MessageProcessors/Mqtt311MessageProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MessageProcessors/Mqtt311MessageProcessor.php b/src/MessageProcessors/Mqtt311MessageProcessor.php index 9148ab3..6a792f8 100644 --- a/src/MessageProcessors/Mqtt311MessageProcessor.php +++ b/src/MessageProcessors/Mqtt311MessageProcessor.php @@ -66,10 +66,10 @@ protected function parseAndValidateSubscribeAcknowledgementMessage(string $data) /** * Determines if the given message is a PUBLISH message and contains the unicode null character U+0000. * - * @param Message $message + * @param Message|null $message * @return bool */ - private function isPublishMessageWithNullCharacter(Message $message): bool + private function isPublishMessageWithNullCharacter(?Message $message): bool { return $message !== null && $message->getType()->equals(MessageType::PUBLISH())