From a1bc9f1ca0ef27914598866bbfc2e68d3ff84a6c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 27 Jul 2014 22:26:48 -0400 Subject: [PATCH] Ensure b:GPGRecipients is initialized to a list value Closes #18 Signed-off-by: James McCoy --- plugin/gnupg.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index dfb2a5b..a5f1092 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1,5 +1,5 @@ " Name: gnupg.vim -" Last Change: 2013 Sep 09 +" Last Change: 2014 Jul 27 " Maintainer: James McCoy " Original Author: Markus Braun " Summary: Vim plugin for transparent editing of gpg encrypted files. @@ -400,7 +400,14 @@ function s:GPGDecrypt(bufread) let filename = expand(":p") " clear GPGRecipients and GPGOptions - let b:GPGRecipients = copy(g:GPGDefaultRecipients) + if type(g:GPGDefaultRecipients) == type([]) + let b:GPGRecipients = copy(g:GPGDefaultRecipients) + else + let b:GPGRecipients = [] + echohl GPGWarning + echom "g:GPGDefaultRecipients is not a Vim list, please correct this in your vimrc!" + echohl None + endif let b:GPGOptions = [] " File doesn't exist yet, so nothing to decrypt