From a2fcf2ee4d7c2711c9f7d22edfe713dca9abe33e Mon Sep 17 00:00:00 2001 From: Aleksandr Voron Date: Fri, 31 Jan 2025 18:59:48 +0100 Subject: [PATCH] check as_type_ptr return --- src/plugins/intel_cpu/src/nodes/pooling.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/pooling.cpp b/src/plugins/intel_cpu/src/nodes/pooling.cpp index dddb55bb154f73..d48a38a849cbf4 100644 --- a/src/plugins/intel_cpu/src/nodes/pooling.cpp +++ b/src/plugins/intel_cpu/src/nodes/pooling.cpp @@ -147,10 +147,11 @@ dnnl::pooling_forward::primitive_desc createDescriptorHelper(const dnnl::engine& bool Pooling::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { #if defined(OV_CPU_WITH_ACL) - auto maxPoolOpBase = ov::as_type_ptr(op); - if (maxPoolOpBase->get_kernel() != ov::Shape(2,2)) { - errorMessage = "Pooling indices returning source tensor coordinates is only supported for pool size 2x2"; - return false; + if (auto maxPoolOpBase = ov::as_type_ptr(op)) { + if (maxPoolOpBase->get_kernel() != ov::Shape(2,2)) { + errorMessage = "Pooling indices returning source tensor coordinates is only supported for pool size 2x2"; + return false; + } } #endif try {