Bug #302

Launcher fails when creating new views

Added by René Neumann about 1 month ago. Updated about 1 month ago.

Status: Fixed Start date: 2012-09-17
Priority: Normal Due date:
Assignee: - % Done:

100%

Category: -
Target version: -
Votes: 0

Description

If doing "some_command @foo", where foo is a not-yet-existing view, 'foo' is created, but Launcher produces a backtrace and some_command is not started.

Backtrace

TypeError: no implicit conversion from nil to integer
    from /home/necoro/.subtle-contrib/ruby/launcher.rb:444:in `tag'
    from /home/necoro/.subtle-contrib/ruby/launcher.rb:444:in `block in run'
    from /home/necoro/.subtle-contrib/ruby/launcher.rb:440:in `each'
    from /home/necoro/.subtle-contrib/ruby/launcher.rb:440:in `run'
    from /home/necoro/.subtle-contrib/ruby/launcher.rb:134:in `run'
    from /home/necoro/.config/subtle.rb:830:in `block in <main>'
    from -e:in `call'

The mentioned lines in subtle.rb:

begin
  require "#{ENV["HOME"]}/.subtle-contrib/ruby/launcher.rb" 
rescue LoadError => error
  puts error
end

grab "W-x" do
  Subtle::Contrib::Launcher.run # line 830
end

The used subtle-contrib revision: bf51b390b689

bug302-fix.patch - Possible fix (422 Bytes) René Neumann, 2012-09-18 22:36

Associated revisions

Revision 3233
Added by Christoph Kappel about 1 month ago

Fixed #302: Set default value to zero for tags

Revision 3235
Added by Christoph Kappel about 1 month ago

Updated #302: Fixed int -> fixnum conversion..

History

The issue is, that the "@tags" attribute of a view is passed to FIX2INT unchecked -- i.e. even if it nil. FIX2INT does not like that.

Attached is a small patch, setting the default value of @tags to "0" instead of nil. This fixes the issue, but I do not know whether the initialization to nil was on purpose. In that case one needs to fix right before the FIX2INT calls.

  • Status changed from Unconfirmed to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:511228884d98.

Thanks for the patch, setting the default to zero is fine. The previous value (nil) remained from the older tag handling, whereas tags were dynamically loaded.

Also available in: Atom PDF