[Bug]: Missing URL causes extension-youtube to throw unhandled runtime error #6168
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Affected Packages
extension-youtube
Version(s)
2.9.0
Bug Description
One of our editors accidentally pasted empty youtube-like iframe:
<div data-youtube-video=""><iframe class="w-full aspect-video" width="640" height="480" allowfullscreen="true" autoplay="false" disablekbcontrols="false" enableiframeapi="false" endtime="0" ivloadpolicy="0" loop="false" modestbranding="false" origin="" playlist="" start="0"></iframe></div>
that caused youtube-plugin to fail on
TypeError: Cannot read properties of null (reading 'match').
I think it should silently fallback instead of throwing an error that causes it's impossible to fix it without directly modifying DB (or temporarily disable youtube extension to fix it directly in tiptap).
Browser Used
Chrome
Code Example URL
No response
Expected Behavior
Throw a console error rather than unhandled runtime error
Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: