Starting with PHP 8.1, substr() generates a warning if the first parameter is null. So, before calling it, we need to check if the changelog is null or not. [MAILPOET-4595]
[MAILPOET-3988]