Fix crash in sch_navigate_tool when history was empty
This commit is contained in:
parent
ce79a16ed8
commit
78e465bbd8
|
@ -145,13 +145,13 @@ int SCH_NAVIGATE_TOOL::Next( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
bool SCH_NAVIGATE_TOOL::CanGoBack()
|
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()
|
bool SCH_NAVIGATE_TOOL::CanGoForward()
|
||||||
{
|
{
|
||||||
return m_navIndex != --m_navHistory.end();
|
return m_navHistory.size() > 0 && m_navIndex != --m_navHistory.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue