Fix a crash that can occur only if there is an error when building a callback (in very rare cases), or in debug mode.