Merge pull request #164 from lytico/lytico_checknull_gtkglue

Gtk.Container & Gtk.CellRenderer: nullcheck in glue-methods
This commit is contained in:
Harry 2020-05-29 09:44:49 +02:00 committed by GitHub
commit 17bd972e29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -127,6 +127,8 @@ namespace Gtk
} }
var obj = TryGetObject (cell); var obj = TryGetObject (cell);
if (obj == default)
return;
var parent = obj.NativeType; var parent = obj.NativeType;
while ((parent = parent.GetBaseType ()) != GLib.GType.None) { while ((parent = parent.GetBaseType ()) != GLib.GType.None) {

View file

@ -137,6 +137,9 @@ namespace Gtk
return; return;
var obj = TryGetObject(container); var obj = TryGetObject(container);
if (obj == default)
return;
var parent = obj.NativeType; var parent = obj.NativeType;
while ((parent = parent.GetBaseType()) != GLib.GType.None) { while ((parent = parent.GetBaseType()) != GLib.GType.None) {
if (parent.ToString().StartsWith("__gtksharp_")) { if (parent.ToString().StartsWith("__gtksharp_")) {