From 399f02147536caf675ed26249225dd430fde8ad4 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 8 Jun 2021 14:23:04 -0400 Subject: [PATCH] Fixed a bug that would crash Fenrir if the clipboard was empty on export to file. --- src/fenrirscreenreader/core/remoteManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/core/remoteManager.py b/src/fenrirscreenreader/core/remoteManager.py index c6394422..c295d25e 100644 --- a/src/fenrirscreenreader/core/remoteManager.py +++ b/src/fenrirscreenreader/core/remoteManager.py @@ -162,7 +162,11 @@ class remoteManager(): self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) return clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') - clipboardFile.write(clipboard) + # Fenrir will crash if the clipboard variable is type None + if clipboard is not None: + clipboardFile.write(clipboard) + else: + clipboardFile.write('') clipboardFile.close() os.chmod(clipboardFilePath, 0o666) self.env['runtime']['outputManager'].presentText(_('clipboard exported to file'), interrupt=True)