7. Update. Can pass lesson but nil doesn't properly return the puts message


#1

when "update" 
    puts "Enter a movie name"
    title = gets.chomp
if movies[title.to_sym].nil
    puts "#{title} does not exist in the database!"
else
    puts "please enter a new rating (Enter a number between 0-5)"
    rating = gets.chomp
    movies [title.to_sym] = rating.to_i
    puts "#{title} has been updated with a new rating of #{rating}"
end

instead of #{title} does not exist in the database!, I get the below:

undefined method `nil' for nil:NilClass


#2

You need to add the question mark at the end of .nil so that it will perform a Boolean test. The 4th line should read like this:

if movies[title.to_sym].nil?