Don't crash regex object finalization when the object is NULL,

for example if there was an error initializing the object.
.gitlab-ci.yml not found in this commit