dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Fixed crash when persisted history cannot be parsed #261

Closed laurent22 closed 7 years ago

laurent22 commented 7 years ago

Under some rare conditions, Vorpal can produce an invalid persisted history which, when loaded, would result in an uncaught exception that crashes the caller. To prevent this, the history is reset when invalid JSON is loaded.

Ideally whatever is causing the invalid JSON to be generated should also be fixed, but I couldn't replicate this. In my case, the JSON was fine except that there was an extra ] at the end - so it would look like ["cmd1","cmd2","cmd3"]].

milesj commented 7 years ago

Cool, thanks!