JSON.parse error in Google Chrome

var origtext = Aes.Ctr.decrypt(recentPatientsFile.read().text, 'L0ck it up saf3', 256); var recentPatientsList = JSON.parse(origtext); 

doing alert(origtext) , I get empty data. JSON.parse (empty data) works fine in other browsers, but in google chrome I get Uncaught SyntaxError: Unexpected end of input . When I remove JSON.parse (), then everything seems fine.

+4
source share
1 answer

Just avoid it

 var value = JSON.parse(origtext || "null"); 
+15
source

Source: https://habr.com/ru/post/1394989/


All Articles