From c4ae1b99a2d16f5fc5a2d76c4ec8082c95f3591c Mon Sep 17 00:00:00 2001 From: realtradam Date: Sat, 25 Apr 2020 18:57:41 -0400 Subject: Skips over nil tracks if the track is nil, code will crash so had to make it skip over files that have nil tracks --- musicSorter.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/musicSorter.rb b/musicSorter.rb index a7ec6d1..73dcd8b 100644 --- a/musicSorter.rb +++ b/musicSorter.rb @@ -18,7 +18,7 @@ for extension in fileExtensions songData = FFruby::File.new(song) #Checks if any of the fields are not filled out - #If they arent, save the song to an error log and skip it, except for track number + #If they arent, save the song to an error log and skip it if songData.title == nil errors.push("ERROR, TITLE IS NIL FOR: " + song) next @@ -36,7 +36,8 @@ for extension in fileExtensions next end if songData.track == nil - errors.push("WARNING, TRACK NUMBER IS NIL BUT MOVED ANYWAY FOR: " + song) + errors.push("ERROR, TRACK NUMBER IS FOR: " + song) + next end #Loads all the values we will want to use -- cgit v1.2.3