lib/storage.rb in sensible-cinema-0.24.5 vs lib/storage.rb in sensible-cinema-0.24.6
- old
+ new
@@ -47,10 +47,15 @@
# Rollback the storage to the latest revision saved to disk or empty it if
# it hasn't been saved.
def rollback
if File.exists?(path)
@storage = YAML.load_file(path)
- raise 'storage file is corrupted--please delete ' + path unless @storage.is_a? Hash
+ unless @storage.is_a? Hash
+
+ $stderr.puts 'storage file is corrupted--deleting ' + path
+ @storage = {}
+ File.delete path
+ end
update_timestamp
else
@storage = {}
end
self