mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-11 11:19:58 +08:00
JS Client: Fixes cannot read properties of null (reading 'is_file') (#5035)
* In transform_output, typeof d can be an object even if the property is_file doesn't exist on d. Therefore invoking d.is_file will error out. This commit fixes that by failing quietly if the is_file property doesn't exist on d. * Update client.ts - fixed spacing fixed spacing * add changeset --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
883ac364f6
commit
8b4eb8cac9
6
.changeset/wild-foxes-clean.md
Normal file
6
.changeset/wild-foxes-clean.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"@gradio/client": minor
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:JS Client: Fixes cannot read properties of null (reading 'is_file')
|
@ -776,7 +776,7 @@ function transform_output(
|
||||
? [normalise_file(img[0], root_url, remote_url), img[1]]
|
||||
: [normalise_file(img, root_url, remote_url), null];
|
||||
});
|
||||
} else if (typeof d === "object" && d.is_file) {
|
||||
} else if (typeof d === "object" && d?.is_file) {
|
||||
return normalise_file(d, root_url, remote_url);
|
||||
} else {
|
||||
return d;
|
||||
|
Loading…
Reference in New Issue
Block a user