diff options
| author | Moss Heim <moss.heim@qt.io> | 2024-03-27 15:46:30 +0100 |
|---|---|---|
| committer | Moss Heim <moss.heim@qt.io> | 2024-04-05 08:33:38 +0000 |
| commit | 6c6a805724a1c56427054b0a9850af5d66ab4879 (patch) | |
| tree | cf10fefcf46f9a9198115ccea9e1808c3c9c5f33 /src | |
| parent | 5d5467849d2298055cb6403be2777005048127fa (diff) | |
Handle empty uri-list in dropped MIME data6.6
Previously WebContentsAdapter assumed that drag-n-drop MIME data with
hasUrls() == true would also have a nonempty url list. This is not
always the case. Instead, check directly if urls() is nonempty.
Fixes: QTBUG-123765
Change-Id: I9e2189e3f0223f98bdd8be273adb96cf063f4be3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit fa8ff1bb933b02f61e406cb29d5c8d4294676a5a)
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/web_contents_adapter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 0f1162b25..78123d138 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1630,7 +1630,7 @@ static void fillDropDataFromMimeData(content::DropData *dropData, const QMimeDat } if (!dropData->filenames.empty()) return; - if (mimeData->hasUrls()) { + if (!urls.empty()) { dropData->url = toGurl(urls.first()); if (mimeData->hasText()) dropData->url_title = toString16(mimeData->text()); |
