src/gui/kernel/qmime_win.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
child 30 5dc02b23752f
--- a/src/gui/kernel/qmime_win.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/kernel/qmime_win.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -640,14 +640,18 @@
         } else if (getCf(formatetc) == CF_INETURL_W) {
             QList<QUrl> urls = mimeData->urls();
             QByteArray result;
-            QString url = urls.at(0).toString();
-            result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort));
+            if (!urls.isEmpty()) {
+                QString url = urls.at(0).toString();
+                result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort));
+            }
             result.append('\0');
             result.append('\0');
             return setData(result, pmedium);
         } else if (getCf(formatetc) == CF_INETURL) {
             QList<QUrl> urls = mimeData->urls();
-            QByteArray result = urls.at(0).toString().toLocal8Bit();
+            QByteArray result;
+            if (!urls.isEmpty())
+                result = urls.at(0).toString().toLocal8Bit();
             return setData(result, pmedium);
         }
     }