Commit d1bb13c3 authored by Christian Hergert's avatar Christian Hergert

code: handle NULL buffer and boxing gracefully

We do a series of cleanups on the state object and we might have lost
our connection to the object graph and or the buffer itself. This handles
those situations gracefully (while still asserting correctness in devel
builds).

Fixes #1297
parent f4e964ad
Pipeline #212916 passed with stages
in 41 minutes and 24 seconds
......@@ -1078,11 +1078,15 @@ ide_buffer_manager_apply_edits_completed_cb (IdeBufferManager *self,
while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&buffer))
{
IdeObjectBox *box = ide_object_box_from_object (G_OBJECT (buffer));
if (buffer != NULL)
{
IdeObjectBox *box = ide_object_box_from_object (G_OBJECT (buffer));
g_assert (IDE_IS_OBJECT_BOX (box));
g_assert (!box || IDE_IS_OBJECT_BOX (box));
ide_object_destroy (IDE_OBJECT (box));
if (box != NULL)
ide_object_destroy (IDE_OBJECT (box));
}
}
IDE_EXIT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment