Fixed a bug in the code host, causing a NullReferenceException when the host was being stopped and there where no subscribers to the DatabaseStopping event.
Merge branch 'issue/1884' into develop. Fixes #1884.