Many callers pass the result of Chart2ModelContact::getDocumentModel()
which resolves a WeakReference<ChartModel> and can return null if the
model has been destroyed. Add null checks matching the existing pattern
in ControllerLockHelper::lockControllers/unlockControllers.
The crash was caused by a race condition where the ChartModel weak
reference (held in Chart2ModelContact) had expired by the time the
chart wrapper code tried to lock controllers during a Copy operation.
The fix gracefully handles the null case instead of dereferencing
a null pointer.
Change-Id: I43294de12b84cefb062ada12e8a570ad3b7ea571
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200268
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit e819e77fe79e8eb48bb3e977fadaffa9e99786f2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204885
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit b8459392b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204952