lib/watch_tower/eye.rb in watch_tower-0.0.2 vs lib/watch_tower/eye.rb in watch_tower-0.0.3
- old
+ new
@@ -25,9 +25,11 @@
# Check if the editor is running
if editor.is_running?
LOG.debug("#{__FILE__}:#{__LINE__}: #{editor.to_s} is running")
# Get the currently being edited file from the editor
files_paths = editor.current_paths
+ # Do not continue if no files were returned
+ next unless files_paths && files_paths.respond_to?(:each)
# Iterate over the files to fill the database
files_paths.each do |file_path|
begin
next unless file_path
LOG.debug("#{__FILE__}:#{__LINE__}: Ignoring #{file_path}") and next if file_path =~ IGNORED_PATHS