Add extra check for nullptr function pointer

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-02-02 09:50:31 +00:00
committed by Compute-Runtime-Automation
parent b2c26dde65
commit ac63175a0f
10 changed files with 34 additions and 2 deletions

View File

@@ -21,6 +21,9 @@ GfxCoreHelperCreateFunctionType gfxCoreHelperFactory[IGFX_MAX_CORE] = {};
std::unique_ptr<GfxCoreHelper> GfxCoreHelper::create(const GFXCORE_FAMILY gfxCoreFamily) {
auto createFunction = gfxCoreHelperFactory[gfxCoreFamily];
if (createFunction == nullptr) {
return nullptr;
}
auto gfxCoreHelper = createFunction();
return gfxCoreHelper;
}