From fcf916d138fd0622b1a055e9742508e2e216ef17 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 21 Aug 2020 21:00:34 +1000 Subject: [PATCH] don't panic --- pkg/gui/patch_building_panel.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go index 6e2bcf8af..b44876f68 100644 --- a/pkg/gui/patch_building_panel.go +++ b/pkg/gui/patch_building_panel.go @@ -125,7 +125,11 @@ func (gui *Gui) secondaryPatchPanelUpdateOpts() *viewUpdateOpts { func (gui *Gui) handleCopyPatchToClipboard() error { // TODO: test that this works - return gui.OSCommand.CopyToClipboard( + if err := gui.OSCommand.CopyToClipboard( strings.Join(gui.GitCommand.PatchManager.RenderEachFilePatch(true), "\n"), - ) + ); err != nil { + return gui.surfaceError(err) + } + + return nil }