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: fix an issue when the media preview is not a string #81

Merged
merged 2 commits into from
Jul 9, 2021

Conversation

jeremydw
Copy link
Member

@jeremydw jeremydw commented Jul 8, 2021

Not sure if this is the right fix but it guards against the crash.

Fixes this error:

Uncaught TypeError: e.path.startsWith is not a function
    at u.get previewUrl [as previewUrl] (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:50873)
    at u.templatePreviewMedia (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:50979)
    at l.templateCollapsed (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:51306)
    at l.template (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:51260)
    at app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:51228
    at app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:35794
    at f.commit (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:36134)
    at o.update (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:36309)
    at f.__commitTemplateResult (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:36161)
    at f.commit (app.min.js?fingerprint=2f9b7d317dbae006e7bc3da2a168810f:formatted:36137)

Value of e.path here is:

_data: "/assets/assets.yaml?howSearchWorks3_small.url"
_type: "pod.yaml"

@jeremydw jeremydw requested a review from Zoramite July 8, 2021 22:33
src/ts/editor/field/media.ts Outdated Show resolved Hide resolved
@Zoramite Zoramite merged commit 5f40ad6 into main Jul 9, 2021
@Zoramite Zoramite deleted the fix/preview-url-path branch July 9, 2021 18:48
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.

None yet

2 participants