diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-05 13:37:37 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-03-05 13:38:46 -0800 |
commit | 2d1ceca077a1624a4bdc6aa26ab8a5113a5f6394 (patch) | |
tree | e21b0fcb85052959a673114b0691f5f7233854fc /app/services/system_hooks_service.rb | |
parent | 8a0052c037f025b64159ca8cfe0d3451261c1edb (diff) | |
download | gitlab-ce-2d1ceca077a1624a4bdc6aa26ab8a5113a5f6394.tar.gz |
Don't error out in system hook if user has `nil` datetime columns
Deleting a user would fail in the system hooks if the user had
`nil` column in `datetime` or `updated_at` fields.
Closes #43871
Diffstat (limited to 'app/services/system_hooks_service.rb')
-rw-r--r-- | app/services/system_hooks_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb index af8c02a10b7..ba7946fd23c 100644 --- a/app/services/system_hooks_service.rb +++ b/app/services/system_hooks_service.rb @@ -20,8 +20,8 @@ class SystemHooksService def build_event_data(model, event) data = { event_name: build_event_name(model, event), - created_at: model.created_at.xmlschema, - updated_at: model.updated_at.xmlschema + created_at: model.created_at&.xmlschema, + updated_at: model.updated_at&.xmlschema } case model |