From 79db23fd80aa33e4bf13dbd330cccaf228ce509f Mon Sep 17 00:00:00 2001 From: lytico Date: Thu, 28 May 2020 22:54:23 +0200 Subject: [PATCH] Gtk.Container.gtksharp_container_base_forall & CellRenderer.gtksharp_cellrenderer_base_get_size: check if obj is null --- Source/Libs/GtkSharp/CellRenderer.GetSize.cs | 2 ++ Source/Libs/GtkSharp/Container.Forall.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Source/Libs/GtkSharp/CellRenderer.GetSize.cs b/Source/Libs/GtkSharp/CellRenderer.GetSize.cs index 41145e44a..d499ae5dd 100644 --- a/Source/Libs/GtkSharp/CellRenderer.GetSize.cs +++ b/Source/Libs/GtkSharp/CellRenderer.GetSize.cs @@ -127,6 +127,8 @@ namespace Gtk } var obj = TryGetObject (cell); + if (obj == default) + return; var parent = obj.NativeType; while ((parent = parent.GetBaseType ()) != GLib.GType.None) { diff --git a/Source/Libs/GtkSharp/Container.Forall.cs b/Source/Libs/GtkSharp/Container.Forall.cs index 788a0dd5f..a6ade093d 100644 --- a/Source/Libs/GtkSharp/Container.Forall.cs +++ b/Source/Libs/GtkSharp/Container.Forall.cs @@ -137,6 +137,9 @@ namespace Gtk return; var obj = TryGetObject(container); + if (obj == default) + return; + var parent = obj.NativeType; while ((parent = parent.GetBaseType()) != GLib.GType.None) { if (parent.ToString().StartsWith("__gtksharp_")) {