Skip to content

Commit 931a51e

Browse files
lanzagarastaric
authored andcommitted
Merge pull request biolab#1827 from janezd/fix-crash-cmd-c
[FIX] Crash on ctrl-c/cmd-c in widgets without graphs (cherry picked from commit be22b64)
1 parent adb4470 commit 931a51e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Orange/widgets/widget.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ def save_graph(self):
339339
saveplot.save_plot(graph_obj, self.graph_writers)
340340

341341
def copy_to_clipboard(self):
342-
graph_obj = getdeepattr(self, self.graph_name, None)
343-
if graph_obj is None:
344-
return
345-
ClipboardFormat.write_image(None, graph_obj)
342+
if self.graph_name:
343+
graph_obj = getdeepattr(self, self.graph_name, None)
344+
if graph_obj is None:
345+
return
346+
ClipboardFormat.write_image(None, graph_obj)
346347

347348
def __restoreWidgetGeometry(self):
348349

0 commit comments

Comments
 (0)