summaryrefslogtreecommitdiffstats
path: root/src/gui/GraphView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/GraphView.cpp')
-rw-r--r--src/gui/GraphView.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp
index a4bc1400..4f76f798 100644
--- a/src/gui/GraphView.cpp
+++ b/src/gui/GraphView.cpp
@@ -100,9 +100,14 @@ GraphView::set_graph(const SPtr<const GraphModel>& graph)
SPtr<GraphView>
GraphView::create(App& app, const SPtr<const GraphModel>& graph)
{
- GraphView* result = nullptr;
- Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win");
+ GraphView* result = nullptr;
+ Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win");
+
xml->get_widget_derived("graph_view_box", result);
+ if (!result) {
+ return nullptr;
+ }
+
result->init(app);
result->set_graph(graph);
return SPtr<GraphView>(result);