Bug 418251 - Crash when dragging first image of thumbnailview
Summary: Crash when dragging first image of thumbnailview
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Thumbnail Viewer (other bugs)
Version First Reported In: 5.6.1
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-27 11:06 UTC by Alex6
Modified: 2020-02-27 22:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex6 2020-02-27 11:06:09 UTC
SUMMARY


STEPS TO REPRODUCE
1. Show thumbnail view
2. Try to drag first thumbnail
3. 

OBSERVED RESULT
Crash:

[ego@xyz ~]$ kphotoalbum
QCommandLineParser: already having an option named "h"
QCommandLineParser: already having an option named "help-all"
QCommandLineParser: already having an option named "v"
ASSERT: "!fileName.isNull()" in file /home/ego/Systeme/kphotoalbum/kphotoalbum/ThumbnailView/ThumbnailModel.cpp, line 196
Abandon (core dumped)
[ego@xyz ~]$ 



EXPECTED RESULT
(no problem whith drag&drop other thumbnail)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Manjaro stable 
(available in About System)
KDE Plasma Version: 19.8.1
KDE Frameworks Version: 5.66.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
Comment 1 Johannes Zarl-Zierl 2020-02-27 21:36:45 UTC
Thanks for the bug report!

At first I could not reproduce this with the demo database, but after some trying around I can confirm that an assertion is triggered if by trying to drag a thumbnail to the very last position.
Comment 2 Johannes Zarl-Zierl 2020-02-27 22:20:26 UTC
Git commit 932eae5390d42557e6b935dcc939dd3cbb3c4bed by Johannes Zarl-Zierl.
Committed on 27/02/2020 at 22:13.
Pushed by johanneszarl into branch 'master'.

Fix crash when dragging an item beyond the last position.

In the thumbnail view, a crash/assertion could be triggered by dragging
an image beyond the last position of the thumbnail view.
Instead of requiring the caller to provide a non-null FileName to
ThumbnailModel::updateCell(), this method now ignores non-null
FileNames.

M  +2    -4    ThumbnailView/ThumbnailDND.cpp
M  +3    -1    ThumbnailView/ThumbnailModel.cpp

https://commits.kde.org/kphotoalbum/932eae5390d42557e6b935dcc939dd3cbb3c4bed
Comment 3 Johannes Zarl-Zierl 2020-02-27 22:23:12 UTC
I believe this bug has been present for a long time. Thanks again for catching it!

I've pushed a fix to git master.