stephenfewer / grinder

Grinder is a system to automate the fuzzing of web browsers and the management of a large number of crashes.
BSD 3-Clause "New" or "Revised" License
414 stars 131 forks source link

Check debugger_restart_minutes for nil in config.rb #35

Closed wchen-r7 closed 10 years ago

wchen-r7 commented 10 years ago

In node's config.rb, the comment for $debugger_restart_minutes says: "Set to nil to disable this feature (restarting debugger)". What happens is if you do set this to nil, $debugger_restart_minutes will be evaluated this way in configuration.rb:

if($debugger_restart_minutes < 5 )
    print_warning( "Warning, you have set the debugger to restart every #{$debugger_restart_minutes} minutes, The Grinder Server will see this node as inactive unless you use a value of more than 5 minutes." )
end

When you do nil < 5, you should get:

NoMethodError: undefined method `<' for nil:NilClass

So this PR fixes that.

I looked around a bit more to see if the same problem exists elsewhere, didn't see anything. grinder.rb uses $debugger_restart_minutes too for the sleep function, but nil condition is already checked in there before calculation. That's probably it.

stephenfewer commented 10 years ago

nicely spotted, thanks!!