From 78e465bbd83b89e62e3beba6b0ce4dc7e75ffc96 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Fri, 3 Jun 2022 23:04:39 +0200 Subject: [PATCH] Fix crash in sch_navigate_tool when history was empty --- eeschema/tools/sch_navigate_tool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/sch_navigate_tool.cpp b/eeschema/tools/sch_navigate_tool.cpp index 8ec2d4f789..8d4441a49d 100644 --- a/eeschema/tools/sch_navigate_tool.cpp +++ b/eeschema/tools/sch_navigate_tool.cpp @@ -145,13 +145,13 @@ int SCH_NAVIGATE_TOOL::Next( const TOOL_EVENT& aEvent ) bool SCH_NAVIGATE_TOOL::CanGoBack() { - return m_navIndex != m_navHistory.begin(); + return m_navHistory.size() > 0 && m_navIndex != m_navHistory.begin(); } bool SCH_NAVIGATE_TOOL::CanGoForward() { - return m_navIndex != --m_navHistory.end(); + return m_navHistory.size() > 0 && m_navIndex != --m_navHistory.end(); }