Skip to content

Commit 2f2caf0

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
1 parent 225ec0d commit 2f2caf0

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
@@ -342,10 +342,11 @@ def save_graph(self):
342342
saveplot.save_plot(graph_obj, self.graph_writers)
343343

344344
def copy_to_clipboard(self):
345-
graph_obj = getdeepattr(self, self.graph_name, None)
346-
if graph_obj is None:
347-
return
348-
ClipboardFormat.write_image(None, graph_obj)
345+
if self.graph_name:
346+
graph_obj = getdeepattr(self, self.graph_name, None)
347+
if graph_obj is None:
348+
return
349+
ClipboardFormat.write_image(None, graph_obj)
349350

350351
def __restoreWidgetGeometry(self):
351352

0 commit comments

Comments
 (0)