From d784b1a5ebd63ec6971241c6e7b1e0fdcc8ac2f0 Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Tue, 21 May 2019 15:17:50 +0300 Subject: [PATCH] #1929: Fix the actions query breaking when querying actions with a non-existent tag --- app/models/todos/undone_todos_query.rb | 3 +++ 1 file changed, 3 insertions(+) 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