Don't try to get a translated empty string
Hashing an empty string can be crashy. And empty strings are reserved in gettext, so we shouldn't try. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15354
This commit is contained in:
parent
620b6b7169
commit
02335010ff
|
@ -123,6 +123,9 @@ TOOL_EVENT TOOL_ACTION::MakeEvent() const
|
||||||
|
|
||||||
wxString TOOL_ACTION::GetLabel() const
|
wxString TOOL_ACTION::GetLabel() const
|
||||||
{
|
{
|
||||||
|
if( m_label.empty() )
|
||||||
|
return wxEmptyString;
|
||||||
|
|
||||||
return wxGetTranslation( m_label );
|
return wxGetTranslation( m_label );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -299,6 +299,9 @@ public:
|
||||||
*/
|
*/
|
||||||
TOOL_EVENT MakeEvent() const;
|
TOOL_EVENT MakeEvent() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the translated label for the action.
|
||||||
|
*/
|
||||||
wxString GetLabel() const;
|
wxString GetLabel() const;
|
||||||
wxString GetMenuItem() const;
|
wxString GetMenuItem() const;
|
||||||
wxString GetTooltip( bool aIncludeHotkey = true ) const;
|
wxString GetTooltip( bool aIncludeHotkey = true ) const;
|
||||||
|
|
Loading…
Reference in New Issue