Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Fixed broken subscriptions (for real this time).
Browse files Browse the repository at this point in the history
  • Loading branch information
hperrin committed May 2, 2019
1 parent 86ddf4f commit 77c8525
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/MessageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private function handleSubscriptionQuery(ConnectionInterface $from, $data) {
if ($count === 0) {
// No more subscribed clients.
unset($this->querySubs[$etype][$serialArgs]);
if (count($this->querySubs[$etype])) {
if (count($this->querySubs[$etype]) === 0) {
unset($this->querySubs[$etype]);
}
return;
Expand Down Expand Up @@ -514,7 +514,9 @@ private function handlePublishEntity(ConnectionInterface $from, $data) {
$entityData['mdate'] = $data['entity']['mdate'];
$entitySData = [];

if ($options['class'] === $data['entity']['class']
if (class_exists($options['class'])
&& class_exists($data['entity']['class'])
&& $options['class']::ETYPE === $data['entity']['class']::ETYPE
&& \Nymph\Nymph::checkData(
$entityData,
$entitySData,
Expand Down

0 comments on commit 77c8525

Please sign in to comment.