techfort/LokiJS — pull request #4 by obeliskos (2014-07-08 22:54:07+00:00)
Title: maxId undefined when Inflating empty collection

Probably a rare use case, but I have encountered it. When inflating a serialized db using loadJSON(), if a collection is empty it will attempt to copy data.maxId to store at collection level, but this is undefined.
I am simply doing a test for 0 data length and setting to 0 if it is (empty). Feel free to implement differently if you want. Thanks for the library!