summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/popup.cpp8
-rw-r--r--src/gui/widgets/window.cpp7
2 files changed, 4 insertions, 11 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index a61ba5275..178695891 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -27,8 +27,6 @@
#include "gui/viewport.h"
-#include "gui/base/exception.hpp"
-
#include "debug.h"
Popup::Popup(const std::string &name,
@@ -48,9 +46,6 @@ Popup::Popup(const std::string &name,
{
logger->log("Popup::Popup(\"%s\")", name.c_str());
- if (!windowContainer)
- throw GCN_EXCEPTION("Popup::Popup(): no windowContainer set");
-
addWidgetListener(this);
if (skin == "")
@@ -67,7 +62,8 @@ Popup::Popup(const std::string &name,
}
}
- windowContainer->add(this);
+ if (windowContainer)
+ windowContainer->add(this);
// Popups are invisible by default
setVisible(false);
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index e9e1ed71e..c250e79a1 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -37,7 +37,6 @@
#include "resources/cursor.h"
#include "resources/image.h"
-#include "gui/base/exception.hpp"
#include "gui/base/focushandler.hpp"
#include "gui/base/font.hpp"
@@ -92,9 +91,6 @@ Window::Window(const std::string &caption, const bool modal,
{
logger->log("Window::Window(\"%s\")", caption.c_str());
- if (!windowContainer)
- throw GCN_EXCEPTION("Window::Window(): no windowContainer set");
-
windowInstances++;
setFrameSize(0);
@@ -142,7 +138,8 @@ Window::Window(const std::string &caption, const bool modal,
}
// Add this window to the window container
- windowContainer->add(this);
+ if (windowContainer)
+ windowContainer->add(this);
if (mModal)
{