Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] gen_sign_user_opts: fall back to default account if no account matches sender
@ 2011-01-18 18:31 Sascha Silbe
  2011-01-19  3:42 ` Rich Lane
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Silbe @ 2011-01-18 18:31 UTC (permalink / raw)
  To: sup-devel

Fixes the following exception:

NoMethodError from thread: main
undefined method `gpgkey' for nil:NilClass
./lib/sup/crypto.rb:226:in `gen_sign_user_opts'
./lib/sup/crypto.rb:48:in `sign'
./lib/sup/util.rb:609:in `send'
./lib/sup/util.rb:609:in `method_missing'
./lib/sup/modes/edit-message-mode.rb:411:in `send'
./lib/sup/modes/edit-message-mode.rb:411:in `build_message'
./lib/sup/modes/edit-message-mode.rb:354:in `send_message'
./lib/sup/mode.rb:59:in `send'
./lib/sup/mode.rb:59:in `handle_input'
./lib/sup/buffer.rb:277:in `handle_input'
bin/sup:260

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
---
The exception originally occured prior to merging the gpgme patch and I
didn't re-test without the patch, but since this part of the code hasn't
changed I expect the results to be the same.

 lib/sup/crypto.rb |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index f8e16c5..02f14d0 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -323,6 +323,7 @@ private
   # else                                    set --local-user from_email_address
   def gen_sign_user_opts from
     account = AccountManager.account_for from
+    account ||= AccountManager.default_account
     if !account.gpgkey.nil?
       opts = {:signers => account.gpgkey}
     elsif AccountManager.user_emails.length == 1
-- 
1.7.2.3

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sup-devel] [PATCH] gen_sign_user_opts: fall back to default account if no account matches sender
  2011-01-18 18:31 [sup-devel] [PATCH] gen_sign_user_opts: fall back to default account if no account matches sender Sascha Silbe
@ 2011-01-19  3:42 ` Rich Lane
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Lane @ 2011-01-19  3:42 UTC (permalink / raw)
  To: Sascha Silbe; +Cc: sup-devel

Applied to master.
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-19  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18 18:31 [sup-devel] [PATCH] gen_sign_user_opts: fall back to default account if no account matches sender Sascha Silbe
2011-01-19  3:42 ` Rich Lane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox