[gnome-builder] ls: handle call after being unloaded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] ls: handle call after being unloaded
- Date: Mon, 22 Jun 2020 18:46:03 +0000 (UTC)
commit 039348ee9d38d754dd233d332d822ac883288506
Author: Christian Hergert <chergert redhat com>
Date: Mon Jun 22 11:45:32 2020 -0700
ls: handle call after being unloaded
Fixes #1233
src/plugins/ls/gbp-ls-workbench-addin.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/ls/gbp-ls-workbench-addin.c b/src/plugins/ls/gbp-ls-workbench-addin.c
index 07c9e29c8..dd73950e4 100644
--- a/src/plugins/ls/gbp-ls-workbench-addin.c
+++ b/src/plugins/ls/gbp-ls-workbench-addin.c
@@ -98,13 +98,22 @@ gbp_ls_workbench_addin_open_async (IdeWorkbenchAddin *addin,
LocateView locate = { 0 };
g_assert (GBP_IS_LS_WORKBENCH_ADDIN (self));
- g_assert (IDE_IS_WORKBENCH (self->workbench));
+ g_assert (!self->workbench || IDE_IS_WORKBENCH (self->workbench));
g_assert (G_IS_FILE (file));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
task = ide_task_new (self, cancellable, callback, user_data);
ide_task_set_source_tag (task, gbp_ls_workbench_addin_open_async);
+ if (self->workbench == NULL)
+ {
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_CANCELLED,
+ "Extension was unloaded");
+ return;
+ }
+
workspace = ide_workbench_get_current_workspace (self->workbench);
if (!(surface = ide_workspace_get_surface_by_name (workspace, "editor")))
surface = ide_workspace_get_surface_by_name (workspace, "terminal");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]