Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: Gaute Hope <eg@gaute.vetsj.com>
To: sup-devel <sup-devel@rubyforge.org>
Subject: Crash on adding contact
Date: Thu, 10 Nov 2011 01:12:27 +0100	[thread overview]
Message-ID: <1320883863-sup-9753@qwerzila> (raw)

[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

Hi,

when adding new contacts (aliases) I get the following error (after
upgrade to ruby 1.9.3):

--- NoMethodError from thread: main
undefined method `email' for "":String
/home/gaute/dev/ruby/sup.git/lib/sup/contact.rb:34:in `update_alias'
/home/gaute/dev/ruby/sup.git/lib/sup/util.rb:572:in `method_missing'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/contact-list-mode.rb:17:in `alias_contact'
/home/gaute/dev/ruby/sup.git/lib/sup/modes/thread-view-mode.rb:259:in `alias'
/home/gaute/dev/ruby/sup.git/lib/sup/mode.rb:59:in `handle_input'
/home/gaute/dev/ruby/sup.git/lib/sup/buffer.rb:278:in `handle_input'
bin/sup:271:in `<module:Redwood>'
bin/sup:80:in `<main>'

The attached patch seems to fix the problem.

Regards,
Gaute

[-- Attachment #2: 0001-Working-check-for-alias-on-ruby-1.9.3.patch --]
[-- Type: application/octet-stream, Size: 793 bytes --]

From 52f17a9a7d7d4ece6db05953627abc65f4145e54 Mon Sep 17 00:00:00 2001
From: Gaute Hope <eg@gaute.vetsj.com>
Date: Thu, 10 Nov 2011 01:09:22 +0100
Subject: [PATCH] Working check for alias on ruby 1.9.3

---
 lib/sup/contact.rb |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/sup/contact.rb b/lib/sup/contact.rb
index 382896d..83ab1d5 100644
--- a/lib/sup/contact.rb
+++ b/lib/sup/contact.rb
@@ -27,7 +27,8 @@ class ContactManager
   def contacts_with_aliases; @a2p.values.uniq end
 
   def update_alias person, aalias=nil
-    if(old_aalias = @p2a[person]) # remove old alias
+    old_aalias = @p2a[person]
+    if(old_aalias != nil and old_aalias != "") # remove old alias
       @a2p.delete old_aalias
       @e2p.delete old_aalias.email
     end
-- 
1.7.7.3


                 reply	other threads:[~2011-11-10  0:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320883863-sup-9753@qwerzila \
    --to=eg@gaute.vetsj.com \
    --cc=sup-devel@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox