rlishtaba / rubyripper

Automatically exported from code.google.com/p/rubyripper
0 stars 0 forks source link

empty .rubyripper/freedb.yaml crashes RubyRipper #404

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a situation where freedb.yaml exists but is empty (I'm not sure
how it happened in my case, might have been an unknown CD or a connection
problem)
2. insert a new CD
3. press 'Scan CD'

What is the expected output? What do you see instead?
Should show disc info of the new CD, crashes instead.

1) What version of rubyripper are you using? On what operating system?
-> Ubuntu Karmic, RubyRipper 0.5.7

2) Are you using the gtk2 or the commandline interface?
-> gui

3) Is the problem gone with the default settings? If so, please attach your
settings file ($HOME/.rubyripper/settings).
-> problem disappears if I delete the empty freedb.yaml

Please provide any additional information below.

Output of 'ruby -d /usr/bin/rrip_gui':

Exception `NoMethodError' at /usr/lib/rubyripper/rr_lib.rb:744 - undefined
method `[]=' for false:FalseClass                                         

Exception thrown: undefined method `[]=' for false:FalseClass

The code in saveResponse obviously should check for a nil return of YAML.load.

Original issue reported on code.google.com by hinsch.m...@gmail.com on 22 Feb 2010 at 11:11

GoogleCodeExporter commented 8 years ago
This is already fixed I believe in latest git, see the lines:

if File.exist?(metadataFile = File.join(ENV['HOME'], '.rubyripper/freedb.yaml'))
@metadataFile = YAML.load(File.open(metadataFile))

#in case it got corrupted somehow
@metadataFile = Hash.new if @metadataFile.class != Hash

Original comment by boukewou...@gmail.com on 24 Apr 2010 at 2:42