From c8f4f34f24d059eae433ab335eb6915cc81b370a Mon Sep 17 00:00:00 2001 From: lukemelia Date: Mon, 16 Oct 2006 06:04:37 +0000 Subject: [PATCH] Fix a bug that occured when an action's project was changed from nil to an actual project. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@329 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/todo_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracks/app/controllers/todo_controller.rb b/tracks/app/controllers/todo_controller.rb index 407942c3..2b6a12c5 100644 --- a/tracks/app/controllers/todo_controller.rb +++ b/tracks/app/controllers/todo_controller.rb @@ -139,7 +139,7 @@ class TodoController < ApplicationController @context_changed = @original_item_context_id != @item.context_id if @context_changed then @remaining_undone_in_context = @user.contexts.find(@original_item_context_id).not_done_todos.length; end @project_changed = @original_item_project_id != @item.project_id - if @project_changed then @remaining_undone_in_project = @user.projects.find(@original_item_project_id).not_done_todos.length; end + if (@project_changed && !@original_item_project_id.nil?) then @remaining_undone_in_project = @user.projects.find(@original_item_project_id).not_done_todos.length; end end def update_context