diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-10-26 17:10:10 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-10-26 16:59:53 +0200 |
commit | 4a8fa1ba2fa5b4e3c95a255c0cb2d45df54aea38 (patch) | |
tree | 27f15294f8cfc53765541c804c1e728e083c7d77 /libreofficekit/qa | |
parent | a76a88203d8508f38b10d9bbb94c3bba2485fcaf (diff) |
gtktiledviewer: don't crash on sidebar creation
There's no dialog parent for the sidebar child window.
Just ignore the signal for now.
Change-Id: Iadfae9174780b10b94e8dd3e6c9efc8c4e8b4b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141878
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'libreofficekit/qa')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx index 8d1b3eb67e10..520472f201e5 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx @@ -367,6 +367,11 @@ void LOKDocViewSigHandlers::window(LOKDocView* pDocView, gchar* pPayload, gpoint { const unsigned nParentId = std::atoi(aRoot.get<std::string>("parentId").c_str()); GtkWindow* pDialog = gtv_application_window_get_child_window_by_id(window, nParentId); + if (!pDialog) + { + g_warning("no parent dialog (id: %d) for created child; is child a sidebar?", nParentId); + return; + } const std::string aPos = aRoot.get<std::string>("position"); std::vector<int> aPosPoints = GtvHelpers::split<int>(aPos, ", ", 2); gtv_lok_dialog_child_create(GTV_LOK_DIALOG(pDialog), nWinId, aPosPoints[0], aPosPoints[1], aSizePoints[0], aSizePoints[1]); |