Skip to content

Fix crash when trying to get a random recipe from no recipe

Pani Ram requested to merge ducksoft/kookbook:master into master

On a fresh start, a click on "Get Random Recipe" button will lead to immediate crash:

Thread 1 "kookbook" received signal SIGSEGV, Segmentation fault.
0x00007ffff6dd09f0 in QString::operator=(QString const&) () from /usr/lib/libQt5Core.so.5
(gdb) bt
#0  0x00007ffff6dd09f0 in QString::operator=(QString const&) () from /usr/lib/libQt5Core.so.5
#1  0x00005555555734aa in ActiveDocument::openPath (this=0x555555a1ca40, file=...) at /usr/src/debug/kookbook/src/core/activedocument.cpp:52
#2  0x0000555555563e11 in MainWindow::showRandomRecipe (this=0x7fffffffe580) at /usr/src/debug/kookbook/src/desktop/mainwindow.cpp:260

This commit will fix that.

Edited by Pani Ram

Merge request reports