huwwp / cryptop

command line crypto portfolio
MIT License
235 stars 40 forks source link

Adding empty coin amount causes bad wallet.json #45

Closed jgoggan closed 6 years ago

jgoggan commented 7 years ago

When adding/updating a coin, if you accidentally put in a proper coin and the comma -- but then no value after that -- it is accepted and written to the wallet.json file, but then causes the app to crash. When you then try to restart it, it will crash again since it has invalid data in the wallet file. You have to manually replace or edit the wallet.json file to get running again.

Example: Hit A and then just do "DOGE," by itself. It'll add this to the json:

"DOGE": ""

...which it then fails to read.

Just wanted to report it. Thanks!

deepbrook commented 6 years ago

I've added a fix for this by eliminating empty amounts (see PR 48). It now defaults to the value "0", which should fix the issue.

huwwp commented 6 years ago

Committed PR 48, thanks.