From b3c305d8bfd3f04fff522c4beaf4712f5cde7cfa Mon Sep 17 00:00:00 2001 From: gambas Date: Thu, 29 Nov 2018 23:55:09 +0100 Subject: [PATCH] Control.Parent does not crash anymore. [GB.GTK] * BUG: Control.Parent does not crash anymore. [GB.GTK3] * BUG: Control.Parent does not crash anymore. --- gb.gtk/src/CWidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gb.gtk/src/CWidget.cpp b/gb.gtk/src/CWidget.cpp index 2158fa834..0e41b5aee 100644 --- a/gb.gtk/src/CWidget.cpp +++ b/gb.gtk/src/CWidget.cpp @@ -791,8 +791,11 @@ BEGIN_PROPERTY(Control_Parent) gContainer *parent = CONTROL->parent(); - while (parent->proxyContainerFor()) - parent = parent->proxyContainerFor(); + if (parent) + { + while (parent->proxyContainerFor()) + parent = parent->proxyContainerFor(); + } GB.ReturnObject(GetObject(parent));