Fix a crash when using some third party plugins and enabling the "two lines for text under icons" option

Fixes #1787700 [Calibre closes after remove toolbar actions](https://bugs.launchpad.net/calibre/+bug/1787700)
This commit is contained in:
Kovid Goyal 2018-08-20 11:47:54 +05:30
parent 19f83cde21
commit 3e0671ba17
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -99,7 +99,7 @@ def wrap_button_text(text, max_len=MAX_TEXT_LENGTH):
def rewrap_button(w):
if not sip.isdeleted(w):
if not sip.isdeleted(w) and w.defaultAction() is not None:
w.setText(wrap_button_text(w.defaultAction().text()))