From b5364e8825e41af574256f1c3cb01b28219c5b75 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 23 Jan 2021 13:23:11 +0100 Subject: Regression: fixed potential crash in ftvhelp.cpp - Found while running doxygen on the gmic project - Cause: vector.back() was called on an empty vector --- src/ftvhelp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 3bcf2c6..f411a60 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -185,9 +185,9 @@ void FTVHelp::decContentsDepth() { m_indent--; std::vector &nl = m_indentNodes[m_indent]; - FTVNode *parent = nl.back(); - if (parent) + if (!nl.empty()) { + FTVNode *parent = nl.back(); std::vector &children = m_indentNodes[m_indent+1]; for (const auto &child : children) { -- cgit v0.12