Fix crash on startup when CMS is disabled
(cherry picked from commit 77df5a44869374f630e273673ee8e61fb059f3d2)