diff options
Diffstat (limited to 'dom/events/Clipboard.cpp')
-rw-r--r-- | dom/events/Clipboard.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dom/events/Clipboard.cpp b/dom/events/Clipboard.cpp index b163bc816f..b797f93961 100644 --- a/dom/events/Clipboard.cpp +++ b/dom/events/Clipboard.cpp @@ -132,6 +132,11 @@ class ClipboardGetCallbackForRead final : public ClipboardGetCallback { } RefPtr<Promise> p(std::move(mPromise)); + if (entries.IsEmpty()) { + p->MaybeResolve(nsTArray<RefPtr<ClipboardItem>>{}); + return NS_OK; + } + // We currently only support one clipboard item. p->MaybeResolve( AutoTArray<RefPtr<ClipboardItem>, 1>{MakeRefPtr<ClipboardItem>( |