Skip to content

Commit

Permalink
Merge pull request #7468 from samihusseingit/master
Browse files Browse the repository at this point in the history
Results could be null and can crash the website
  • Loading branch information
bewest authored Jun 30, 2022
2 parents 555f699 + e601717 commit e72924c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/server/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function init (env, ctx, server) {
ctx.store.collection(collection).findOne({ '_id': id }
, function(err, results) {
console.log('Got results', results);
if (!err) {
if (!err && results !== null) {
ctx.bus.emit('data-update', {
type: data.collection
, op: 'update'
Expand Down Expand Up @@ -266,7 +266,7 @@ function init (env, ctx, server) {
ctx.store.collection(collection).findOne({ '_id': objId }
, function(err, results) {
console.log('Got results', results);
if (!err) {
if (!err && results !== null) {
ctx.bus.emit('data-update', {
type: data.collection
, op: 'update'
Expand Down

0 comments on commit e72924c

Please sign in to comment.