Blob Blame History Raw
diff -up widelands-build17-src/src/ui_basic/window.cc.crash-on-messagebox widelands-build17-src/src/ui_basic/window.cc
--- widelands-build17-src/src/ui_basic/window.cc.crash-on-messagebox	2012-04-23 11:46:49.000000000 +0200
+++ widelands-build17-src/src/ui_basic/window.cc	2012-06-25 14:00:05.677491646 +0200
@@ -252,12 +252,15 @@ void Window::move_inside_parent() {
 */
 void Window::center_to_parent()
 {
-	Panel & parent = *get_parent();
+	Panel * parent = get_parent();
+
+    if (!parent)
+        return;
 
 	set_pos
 		(Point
-		((static_cast<int32_t>(parent.get_inner_w()) - get_w()) / 2,
-		 (static_cast<int32_t>(parent.get_inner_h()) - get_h()) / 2));
+		((static_cast<int32_t>(parent->get_inner_w()) - get_w()) / 2,
+		 (static_cast<int32_t>(parent->get_inner_h()) - get_h()) / 2));
 }