nginx SSL PEM_read_bio:bad end line

Installing the intermediate certificates on our server gave me the following error while trying to start up nginx again:

The end of the file looked fine, but the problem was half way through it. Somehow the concatenation had joined two lines together:

This just needed a line break to fix: