diff -r 764381756899 -r 62373840e33a src/model.h --- a/src/model.h Wed Mar 11 19:05:34 2020 +0200 +++ b/src/model.h Tue Mar 17 23:13:29 2020 +0200 @@ -135,5 +135,12 @@ { *index_out = index; } - return static_cast(this->objectAt(index)); + if (index.isValid()) + { + return static_cast(this->objectAt(index)); + } + else + { + return nullptr; + } }