mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-26 11:52:42 -08:00
add handling to some places in javascript that can potentially cause issues #6898
This commit is contained in:
parent
79d802b48a
commit
c12d7ddd72
2 changed files with 13 additions and 6 deletions
|
|
@ -81,8 +81,13 @@ function request(url, data, handler, errorHandler){
|
|||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === 4) {
|
||||
if (xhr.status === 200) {
|
||||
var js = JSON.parse(xhr.responseText);
|
||||
handler(js)
|
||||
try {
|
||||
var js = JSON.parse(xhr.responseText);
|
||||
handler(js)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
errorHandler()
|
||||
}
|
||||
} else{
|
||||
errorHandler()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue