Patch #38139

Add guard clause to time_tag method to handle nil time

Added by Go MAEDA about 1 month ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:5.1.0

Description

This patch prevents an Internal Server Error from occurring when a nil value is passed to the time_tag method.

For some reason, a table's created_at or updated_at may have an invalid value "0000-00-00 00:00". In this case, a nil value is passed to time_tag and the user encounters an Internal Server Error. This situation has been reported in #12026 and #12826.

add-guard-clause-to-time-tag.patch Magnifier (1.26 KB) Go MAEDA, 2023-01-01 07:42


Related issues

Related to Redmine - Defect #12026: 500 error on user page after migrating from Trac to RedMi... Closed
Related to Redmine - Defect #12826: Error viewing some issues: ActionView::Template::Error (u... Closed

Associated revisions

Revision 22022
Added by Go MAEDA about 1 month ago

Add guard clause to time_tag method to handle nil time (#38139).

Patch by Go MAEDA.

History

#1 Updated by Go MAEDA about 1 month ago

  • Related to Defect #12026: 500 error on user page after migrating from Trac to RedMine 2.0.3 added

#2 Updated by Go MAEDA about 1 month ago

  • Related to Defect #12826: Error viewing some issues: ActionView::Template::Error (undefined method `-' for nil:NilClass): added

#3 Updated by Go MAEDA about 1 month ago

  • File deleted (add-guard-clause-to-time-tag.patch)

#5 Updated by Go MAEDA about 1 month ago

  • Target version set to 5.1.0

Setting the target version to 5.1.0.

#6 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Also available in: Atom PDF