Skip to content

timelinemodel fix crash if json array is empty

Fix issue "tokodon crashes with backtrace #5  0x00007ffff5690caf in QMessageLogger::fatal(char const*, ...) const () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#6  0x00007ffff5690020 in qt_assert(char const*, char const*, int) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#7  0x00005555555a504c in QList<Post*>::first (this=0x7fffffffd110) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:361
No locals.
#8  0x00005555555a357f in TimelineModel::fetchedTimeline (this=0x555555f87a90, data=...) at /home/n/kde/src/tokodon/src/timelinemodel.cpp:78
        postOld = 0x55555630c1c0
        postNew = 0x2
        posts = {<QListSpecialMethods<Post*>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = std::atomic<int> = { -1 }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7ffff59a6630 <QListData::shared_null>}, d = 0x7ffff59a6630 <QListData::shared_null>}}
        doc = {static BinaryFormatTag = 1936351857, d = std::unique_ptr<QJsonDocumentPrivate> = {get() = 0x55555643fbf0}}
        array = {dead = 0x0, a = {d = 0x555556322680}}
#9  0x00005555555c0d90 in operator() (__closure=0x555556390650, reply=0x555556462e70) at /home/n/kde/src/tokodon/src/maintimelinemodel.cpp:104
        uri = {d = 0x5555564bccd0}
        account = 0x55555577b120
        currentTimelineName = {d = 0x5555555f3be0 <MainTimelineModel::MainTimelineModel(QObject*)::{lambda()#1}::operator()() const::qstring_literal>}
        this = 0x555555f87a90
#10 0x00005555555c1850 in std::__invoke_impl<void, MainTimelineModel::fillTimeline(const QString&)::<lambda(QNetworkReply*)>&, QNetworkReply*>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/12/bits/invoke.h:61
No locals.
#11 0x00005555555c16fc in std::__invoke_r<void, MainTimelineModel::fillTimeline(const QString&)::<lambda(QNetworkReply*)>&, QNetworkReply*>(struct {...} &) (__fn=...) at /usr/include/c++/12/bits/invoke.h:111
No locals.
#12 0x00005555555c14e1 in std::_Function_handler<void(QNetworkReply*), MainTimelineModel::fillTimeline(const QString&)::<lambda(QNetworkReply*)> >::_M_invoke(const std::_Any_data &, QNetworkReply *&&) (__functor=..., __args#0=@0x7fffffffd260: 0x555556462e70) at /usr/include/c++/12/bits/std_function.h:290
No locals.
#13 0x000055555559069f in std::function<void (QNetworkReply*)>::operator()(QNetworkReply*) const (this=0x55555644a948, __args#0=0x555556462e70) at /usr/include/c++/12/bits/std_function.h:591
No locals."
Edited by Raresh Rus

Merge request reports