aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlworkerscript/qquickworkerscript.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-12-23 14:46:35 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-01-02 09:48:20 +0100
commita35b40418668da1989a424b733a780e1ff28b0f3 (patch)
tree8273d8526b450d4ba5cd90935a8da55bae87c2e5 /src/qmlworkerscript/qquickworkerscript.cpp
parente367e2c9dfcc2e832ce846829edf978d67291633 (diff)
QQmlAdaptorModel: Guard access to wrapped AIM
The QAbstractItemModel may be nullptr, in particular when it gets deleted from the outside. In some places we did check for that, via operator T* from QQmlGuard, in others we didn't. The checks were quite hard to read as "if (model)" first invokes a conversion operator on a base class and then implicitly converts the result to bool. Similarly adventurous, "if (*model)" invokes operator* on a base class and then converts the result to bool. Make all the checks explicit, and add new ones where they were missing. Also, as we already retrieve the AIM in order to check it for nullptr, re-use it for the actual operation. Task-number: QTBUG-80963 Change-Id: I3548e22e9d2bef485a1cd4acf70839eb8e599e62 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qmlworkerscript/qquickworkerscript.cpp')
0 files changed, 0 insertions, 0 deletions