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

fix(core): avoid attempting to render media preview images when no value is set #7375

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

runeb
Copy link
Member

@runeb runeb commented Aug 15, 2024

Description

The current code attempts to construct an image URL for undefined. This results in a thrown (caught) exception which we can avoid by checking this value before attempting to render. This will happen per item in a document list that does not have a value to render for its media image. This change checks for a value before attempting to use it, which avoids the exception and overhead associated with that.

What to review

That there are no side-effects to avoiding this attempted render

Testing

Manual testing to verify that media preview images are rendering as expected.

Notes for release

Not required

@runeb runeb requested a review from a team as a code owner August 15, 2024 23:12
@runeb runeb requested review from ricokahler and removed request for a team August 15, 2024 23:12
Copy link

vercel bot commented Aug 15, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 11:17pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 11:17pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 11:17pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 11:17pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 11:17pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Aug 15, 2024 11:17pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Aug 15, 2024 11:28 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 43s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 36s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 10s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 43s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 46s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 13s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 8s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 25s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 17s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 1m 23s 20 0 1
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 1m 45s 30 0 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 19s 3 0 0

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.

1 participant