From 1b1cfe4837ee7776317f63bb92edcee2d1903b9c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 23 Mar 2018 10:06:38 +0000 Subject: a11y crash with no chars selected in character map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit type gibberish in character map search box, click character map widget, crash Change-Id: Ifa3e4bce2d7e0b84cf3c5033eb819c73076daabe Reviewed-on: https://gerrit.libreoffice.org/51773 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/dialog/searchcharmap.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx index 9ede4272cf8f..97f130d41e79 100644 --- a/svx/source/dialog/searchcharmap.cxx +++ b/svx/source/dialog/searchcharmap.cxx @@ -437,7 +437,8 @@ svx::SvxShowCharSetItem* SvxSearchCharSet::ImplGetItem( int _nPos ) aFind = m_aItems.emplace(_nPos, xItem).first; OUStringBuffer buf; std::unordered_map::const_iterator got = m_aItemList.find (_nPos); - buf.appendUtf32( got->second ); + if (got != m_aItemList.end()) + buf.appendUtf32(got->second); aFind->second->maText = buf.makeStringAndClear(); Point pix = MapIndexToPixel( _nPos ); aFind->second->maRect = tools::Rectangle( Point( pix.X() + 1, pix.Y() + 1 ), Size(nX-1,nY-1) ); -- cgit