summaryrefslogtreecommitdiffstats
path: root/src/gui/GraphBox.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-09-22 12:36:22 -0400
committerDavid Robillard <d@drobilla.net>2023-09-22 12:36:29 -0400
commitb25b04a88767ae3dc142076dd3bdeefbaa549690 (patch)
treeb20193a611d4525962a09486f94aa5eb609c2298 /src/gui/GraphBox.cpp
parent97f5ecf41bccbc6339a18c649cd7bfcd84b18312 (diff)
downloadingen-b25b04a88767ae3dc142076dd3bdeefbaa549690.tar.gz
ingen-b25b04a88767ae3dc142076dd3bdeefbaa549690.tar.bz2
ingen-b25b04a88767ae3dc142076dd3bdeefbaa549690.zip
Avoid potential null dereferences
Diffstat (limited to 'src/gui/GraphBox.cpp')
-rw-r--r--src/gui/GraphBox.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 414bbef4..9efba2ee 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -252,6 +252,10 @@ GraphBox::create(App& app, const std::shared_ptr<const GraphModel>& graph)
GraphBox* result = nullptr;
const Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("graph_win");
xml->get_widget_derived("graph_win_vbox", result);
+ if (!result) {
+ return {};
+ }
+
result->init_box(app);
result->set_graph(graph, nullptr);