Skip to content

gitlab: handle "last_commit: null" properly

BryanDavis requested to merge work/bd808/gitlab-task-bug into main

Avoid an "AttributeError: 'NoneType' object has no attribute 'get'" error when event["object_attributes"]["last_commit"] is None by explicitly setting last_commit to an empty string in that case. The subtle logic bug with the prior implementation is that dict.get(key, default) only returns the passed default value if the key is not found in the dict. When the key exists and has None or another falsey value the value will still be returned.

Merge request reports