diff --git a/src/sakia/gui/widgets/context_menu.py b/src/sakia/gui/widgets/context_menu.py
index eddb20306f3b60fa14d00b321d6e16695d11df55..60e7b4a14ca899b66231c30894fe693978ee6b76 100644
--- a/src/sakia/gui/widgets/context_menu.py
+++ b/src/sakia/gui/widgets/context_menu.py
@@ -174,7 +174,8 @@ QMessageBox.Ok | QMessageBox.Cancel)
     async def copy_transaction_to_clipboard(self, tx):
         clipboard = QApplication.clipboard()
         raw_doc = await tx.get_raw_document(self._community)
-        clipboard.setText(raw_doc.signed_raw())
+        if raw_doc:
+            clipboard.setText(raw_doc.signed_raw())
 
     @asyncify
     async def copy_block_to_clipboard(self, number):