8000 Merge pull request #18328 from anntzer/qtm · matplotlib/matplotlib@9cd1152 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cd1152

Browse files
authored
Merge pull request #18328 from anntzer/qtm
Add missing check for None in Qt toolmanager.
2 parents 9c00569 + b3dc410 commit 9cd1152

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)
0