Closed marvinroger closed 8 years ago
of course! Would you mind to send a quick pr? maybe we can even add a unit test about this case to https://github.com/mcollina/aedes-persistence/blob/master/abstract.js
I would just remove the condition that puts sub to null
, it seems useless to other parts of the code. Regarding the unit test, I'll let you implement it as I am not familiar enough with aedes ;)
Line 164, if
resubs
is empty, you're affecting itnull
. Line 206, you're consideringsubs
is always an array, which is not the case as it can be null.Basically, a
TypeError: Cannot read property 'map' of null
error appears with an empty database.