Skip to content

song_with_id( nil ) causes error #54

@Phrogz

Description

@Phrogz

A silly edge case, but:

begin; @mpd.song_with_id(1); rescue MPD::Error=>e; puts e; end
#=> [playlistid] No such song

begin; @mpd.song_with_id(-1); rescue MPD::Error=>e; puts e; end
#=> [playlistid] Number too large: -1

begin; @mpd.song_with_id('cat'); rescue MPD::Error=>e; puts e; end
#=> [playlistid] Integer expected: cat

begin; @mpd.song_with_id(nil); rescue MPD::Error=>e; puts e; end
NoMethodError: undefined method `delete' for true:TrueClass
        from /var/lib/gems/2.1.0/gems/ruby-mpd-0.3.3/lib/ruby-mpd/song.rb:13:in `initialize'
        from /var/lib/gems/2.1.0/gems/ruby-mpd-0.3.3/lib/ruby-mpd/plugins/queue.rb:81:in `new'
        from /var/lib/gems/2.1.0/gems/ruby-mpd-0.3.3/lib/ruby-mpd/plugins/queue.rb:81:in `song_with_id'
        ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions