From 6bb22caea2271cc7d7d47ac608a48de5abe79622 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 6 Nov 2022 11:42:51 +0000 Subject: [PATCH] PUI Compat: handle failed loads without crash --- src/GUI/FGPUICompatDialog.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GUI/FGPUICompatDialog.cxx b/src/GUI/FGPUICompatDialog.cxx index 18236a30c..ba45775ee 100644 --- a/src/GUI/FGPUICompatDialog.cxx +++ b/src/GUI/FGPUICompatDialog.cxx @@ -108,8 +108,10 @@ FGPUICompatDialog::FGPUICompatDialog(SGPropertyNode* props) : FGDialog(props), FGPUICompatDialog::~FGPUICompatDialog() { - _peer->callMethod("doClose"); - + if (_peer) { + _peer->callMethod("doClose"); + } + _props->setIntValue("lastx", getX()); _props->setIntValue("lasty", getY()); // FIXME: save width/height as well?