This was introduced on ecc395e473. Effectively this is reverting that commit for cases when scene->toolsettings->sculpt is NULL. But since the facesets are only working for sculpting this should be fine.
ecc395e473
make format