From 3f7e5d2ce4d0149e154e2f89e64b3b968d2abb10 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 19 Sep 2018 15:32:51 -0400 Subject: [PATCH] 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 --- eeschema/block.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eeschema/block.cpp b/eeschema/block.cpp index 443c3c96fa..91d756d057 100644 --- a/eeschema/block.cpp +++ b/eeschema/block.cpp @@ -2,8 +2,8 @@ * 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) 2009-2016 Wayne Stambaugh - * Copyright (C) 2004-2016 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2009 Wayne Stambaugh + * Copyright (C) 2004-2018 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or * 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; - if( !m_canvas->IsMouseCaptured() ) - { - DisplayError( this, wxT( "HandleBlockPLace() : m_mouseCaptureCallback = NULL" ) ); - } + wxCHECK_RET( m_canvas->IsMouseCaptured(), "No block mouse capture callback is set" ); if( block->GetCount() == 0 ) {