summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-09-20 04:43:20 +0000
committerGo MAEDA <maeda@farend.jp>2023-09-20 04:43:20 +0000
commit3928d82ee101752567d7086824f91d463be90745 (patch)
treeead2d8cd58f9f93be90131045d6e2b0dd6bdb2be /app
parentc9aed18ee58f20dc33f796bc864cfbccc9a52409 (diff)
downloadredmine-3928d82ee101752567d7086824f91d463be90745.tar.gz
redmine-3928d82ee101752567d7086824f91d463be90745.zip
Avoid exception during validation if the spent_on date of a time entry was removed (#39079).
Patch by Holger Just. git-svn-id: https://svn.redmine.org/redmine/trunk@22311 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/time_entry.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index b327f861f..38504b774 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -179,7 +179,7 @@ class TimeEntry < ActiveRecord::Base
end
errors.add :issue_id, :invalid if (issue_id && !issue) || (issue && project!=issue.project) || @invalid_issue_id
errors.add :activity_id, :inclusion if activity_id_changed? && project && !project.activities.include?(activity)
- if spent_on_changed? && user
+ if spent_on && spent_on_changed? && user
errors.add :base, I18n.t(:error_spent_on_future_date) if !Setting.timelog_accept_future_dates? && (spent_on > user.today)
end
end