domcrypt
domcrypt copied to clipboard
gracefully deal with an empty config file
When an error occurs during the very first initialisation of DOMCrypt, the config file .mozCipher.json
may be created as an empty file. On subsequent initialisations of the extension, DOMCrypt will then fail to parse the empty contents, results in a failure to initialise.
Instead of attempting to parse empty contents, DOMCrypt should treat an empty config file as if it didn't exist and overwrite it.
I/O is hard! Thanks!