Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS Client: Fixes cannot read properties of null (reading 'is_file') #5035

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

raymondtri
Copy link
Contributor

Description

In transform_output, typeof d can be an object even if the property is_file doesn't exist on d. Therefore attempting to access d.is_file will error out. This commit fixes that by failing quietly if the is_file property doesn't exist on d.

Closes: (no issue, the fix is very small)

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

The fix is very small.

raymondtri and others added 2 commits July 28, 2023 13:04
…s_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.
@vercel
Copy link

vercel bot commented Jul 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
gradio ✅ Ready (Inspect) Visit Preview Jul 28, 2023 8:49pm

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 28, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/client minor
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

JS Client: Fixes cannot read properties of null (reading 'is_file')

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs
Copy link
Member

Hi @raymondtri thanks for the contribution. Can you give a quick code example of where you're seeing this issue?

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 28, 2023

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-5035-all-demos


You can install the changes in this PR by running:

pip install https://gradio-builds.s3.amazonaws.com/0e97ff844776dd6a99d0f31aeffb775bf0564583/gradio-3.39.0-py3-none-any.whl

@abidlabs
Copy link
Member

abidlabs commented Aug 1, 2023

Hi @raymondtri just to follow up, can you share an example of what issue this PR is fixing?

@abidlabs
Copy link
Member

abidlabs commented Aug 1, 2023

Will go ahead and merge this in. Though would still be good to know what triggered this error!

@abidlabs abidlabs merged commit 8b4eb8c into gradio-app:main Aug 1, 2023
@pngwn pngwn mentioned this pull request Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants