8000 Backport PR #18328: Add missing check for None in Qt toolmanager. · matplotlib/matplotlib@a93b9fd · GitHub
[go: up one dir, main page]

Skip to content

Commit a93b9fd

Browse files
dstansbymeeseeksmachine
authored andcommitted
Backport PR #18328: Add missing check for None in Qt toolmanager.
1 parent bd6f39b commit a93b9fd

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
@@ -916,7 +916,8 @@ def add_toolitem(
916916
self, name, group, position, image_file, description, toggle):
917917

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

0 commit comments

Comments
 (0)
0