Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
Ensure doc is defined before accessing properties
Browse files Browse the repository at this point in the history
  • Loading branch information
phillmac authored and aphelionz committed Aug 18, 2020
1 parent 5d9c121 commit f894316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DocumentIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DocumentIndex {
const reducer = (handled, item, idx) => {
if (item.payload.op === 'PUTALL' && item.payload.docs[Symbol.iterator]) {
for (const doc of item.payload.docs) {
if (handled[doc.key] !== true) {
if (doc && handled[doc.key] !== true) {
handled[doc.key] = true
this._index[doc.key] = {
payload: {
Expand Down

0 comments on commit f894316

Please sign in to comment.