Fixed `ExtensionTest/CocoStudioComponentsTest` crash after applying PR #6011.

Fixed `ExtensionTest/CocoStudioComponentsTest` crash after applying PR #6011.