Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethod error caused by nil users #10

Open
davidbartonau opened this issue Nov 17, 2018 · 1 comment
Open

NoMethod error caused by nil users #10

davidbartonau opened this issue Nov 17, 2018 · 1 comment

Comments

@davidbartonau
Copy link
Contributor

I believe pull request #5 is causing errors. I ran through the change log and that was the commit that caused this error @heuri

I'm not a ruby programmer, but I will attempt to fix it :-/

Traceback (most recent call last):
	11: from /home/sandbox/.gem/ruby/2.5.0/bin/hipmost:23:in `<main>'
	10: from /home/sandbox/.gem/ruby/2.5.0/bin/hipmost:23:in `load'
	 9: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/exe/hipmost:48:in `<top (required)>'
	 8: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost.rb:14:in `run'
	 7: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:23:in `run'
	 6: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:47:in `import'
	 5: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:54:in `save'
	 4: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:54:in `open'
	 3: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:64:in `block in save'
	 2: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:64:in `each'
	 1: from /home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/cmds/room.rb:65:in `block (2 levels) in save'
/home/sandbox/.gem/ruby/2.5.0/gems/hipmost-1.0/lib/hipmost/hipchat/room.rb:46:in `users': undefined method `[]' for nil:NilClass (NoMethodError)
        if not attrs["members"].first.is_a? Integer
          @users ||= [ Hipchat.users[attrs["members"].first["id"]] ]  # <-------
        else
          @users ||= attrs["members"].map{|uid| Hipchat.users[uid] }
        end
davidbartonau added a commit to davidbartonau/hipmost that referenced this issue Nov 17, 2018
@davidbartonau
Copy link
Contributor Author

@heuri I put in a fix that works for me in my fork, but I may have broken your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant