Eeschema: fix minor bug in block handler.

Under certain conditions, it was possible for the block handler to be
entered with no mouse capture callback which would raise a rather
cryptic error message to the user.  This should have always been an
assertion so users will not see this issue in release builds.

Fixes lp:1791839

https://bugs.launchpad.net/kicad/+bug/1791839
This commit is contained in:
Wayne Stambaugh 2018-09-19 15:32:51 -04:00
parent ed94f2c5e0
commit 3f7e5d2ce4
1 changed files with 3 additions and 6 deletions

View File

@ -2,8 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2009-2016 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2009 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -104,10 +104,7 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
{ {
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
if( !m_canvas->IsMouseCaptured() ) wxCHECK_RET( m_canvas->IsMouseCaptured(), "No block mouse capture callback is set" );
{
DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) );
}
if( block->GetCount() == 0 ) if( block->GetCount() == 0 )
{ {