diff --git a/app/models/todos/undone_todos_query.rb b/app/models/todos/undone_todos_query.rb index b4980870..18a630ac 100644 --- a/app/models/todos/undone_todos_query.rb +++ b/app/models/todos/undone_todos_query.rb @@ -27,6 +27,9 @@ module Todos if params[:tag] tag = Tag.where(:name => params[:tag]).first + if not tag + return [] + end not_done_todos = not_done_todos.joins(:taggings).where('taggings.tag_id = ?', tag.id) end