Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3dc410

Browse files
committed
Add missing check for None in Qt toolmanager.
(The fix is already there in all other backends.)
1 parent 48b6327 commit b3dc410

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/backends/backend_qt5.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,8 @@ def add_toolitem(
917917
self, name, group, position, image_file, description, toggle):
918918

919919
button = QtWidgets.QToolButton(self)
920-
button.setIcon(NavigationToolbar2QT._icon(self, image_file))
920+
if image_file:
921+
button.setIcon(NavigationToolbar2QT._icon(self, image_file))
921922
button.setText(name)
922923
if description:
923924
button.setToolTip(description)

0 commit comments

Comments
 (0)