diff --git a/foreach/foreach_addcdiv_scalar/op_host/op_api/aclnn_foreach_addcdiv_scalar.cpp b/foreach/foreach_addcdiv_scalar/op_host/op_api/aclnn_foreach_addcdiv_scalar.cpp
index 5f11184bb..315dbc307 100644
--- /opt/cloud/slavespace/usr1/096471637100f3de0fcfc01072822a80/ut/foreach/foreach_addcdiv_scalar/op_host/op_api/aclnn_foreach_addcdiv_scalar.cpp
+++ /opt/cloud/slavespace/usr1/096471637100f3de0fcfc01072822a80/ut/foreach/foreach_addcdiv_scalar/op_host/op_api/aclnn_foreach_addcdiv_scalar.cpp
@@ -132,6 +132,34 @@
                                       const aclTensor* scalar, const aclTensorList* out)
 {
     CHECK_RET(CheckNotNull(x1, x2, x3, scalar, out), ACLNN_ERR_PARAM_NULLPTR);
+
+    // Check every entry in tensor lists is not null, to avoid null pointer
+    // dereference in CheckDtypeValid/CheckShape/CheckFormat.
+    for (uint64_t i = 0; i < x1->Size(); i++) {
+        if ((*x1)[i] == nullptr) {
+            OP_LOGE(ACLNN_ERR_PARAM_INVALID, "x1[%lu] is null.", i);
+            return ACLNN_ERR_PARAM_INVALID;
+        }
+    }
+    for (uint64_t i = 0; i < x2->Size(); i++) {
+        if ((*x2)[i] == nullptr) {
+            OP_LOGE(ACLNN_ERR_PARAM_INVALID, "x2[%lu] is null.", i);
+            return ACLNN_ERR_PARAM_INVALID;
+        }
+    }
+    for (uint64_t i = 0; i < x3->Size(); i++) {
+        if ((*x3)[i] == nullptr) {
+            OP_LOGE(ACLNN_ERR_PARAM_INVALID, "x3[%lu] is null.", i);
+            return ACLNN_ERR_PARAM_INVALID;
+        }
+    }
+    for (uint64_t i = 0; i < out->Size(); i++) {
+        if ((*out)[i] == nullptr) {
+            OP_LOGE(ACLNN_ERR_PARAM_INVALID, "out[%lu] is null.", i);
+            return ACLNN_ERR_PARAM_INVALID;
+        }
+    }
+
     CHECK_RET(CheckDtypeValid(x1, x2, x3, scalar, out), ACLNN_ERR_PARAM_INVALID);
     CHECK_RET(CheckShape(x1, x2, x3, out), ACLNN_ERR_PARAM_INVALID);
     CHECK_RET(CheckFormat(x1, x2, x3, out), ACLNN_ERR_PARAM_INVALID);

