From 6ff13ee2a86a516f27fa80bc9253781dfd3c7787 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 26 May 2022 23:07:24 -0400 Subject: Avoid potential null dereferences As judged by GCC anyway. --- src/Patchage.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Patchage.cpp') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 86d5dbf..7d10abf 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -639,9 +639,11 @@ update_edge_color(GanvEdge* edge, void* data) auto* patchage = static_cast(data); Ganv::Edge* edgemm = Glib::wrap(edge); - auto* tail = dynamic_cast((edgemm)->get_tail()); - if (tail) { - edgemm->set_color(patchage->conf().get_port_color(tail->type())); + if (edgemm) { + auto* tail = dynamic_cast((edgemm)->get_tail()); + if (tail) { + edgemm->set_color(patchage->conf().get_port_color(tail->type())); + } } } -- cgit v1.2.1