fix #22799: crash on startup on mac osx