Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4240a72

Browse files
committedOct 2, 2016
Check for FolderModelItem info (and FmPath)
This is a shot in the dark to prevent rare crashes (lxqt/pcmanfm-qt#397).
1 parent 0966bb7 commit 4240a72

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
 

‎src/foldermodel.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,15 @@ QMimeData* FolderModel::mimeData(const QModelIndexList& indexes) const {
366366
for(const auto &index : indexes) {
367367
FolderModelItem* item = itemFromIndex(index);
368368
if(item) {
369-
FmPath* path = fm_file_info_get_path(item->info);
370-
char* uri = fm_path_to_uri(path);
371-
urilist.append(uri);
372-
urilist.append('\n');
373-
g_free(uri);
369+
if(item->info) {
370+
FmPath* path = fm_file_info_get_path(item->info);
371+
if(path) {
372+
char* uri = fm_path_to_uri(path);
373+
urilist.append(uri);
374+
urilist.append('\n');
375+
g_free(uri);
376+
}
377+
}
374378
}
375379
}
376380
data->setData("text/uri-list", urilist);

0 commit comments

Comments
 (0)
Please sign in to comment.