Skip to content

Commit 45219f3

Browse files
authored
Check for nullptr in MethodMeta::uses_backend (#9457)
1 parent 4894170 commit 45219f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/executor/method_meta.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,11 @@ Result<int64_t> MethodMeta::memory_planned_buffer_size(size_t index) const {
229229
}
230230

231231
bool MethodMeta::uses_backend(const char* backend_name) const {
232+
ET_CHECK_MSG(backend_name, "backend name is null");
232233
const auto delegates = s_plan_->delegates();
233234
for (size_t i = 0; i < delegates->size(); i++) {
234235
auto delegate = delegates->Get(i);
235-
if (strcmp(delegate->id()->c_str(), backend_name) == 0) {
236+
if (std::strcmp(delegate->id()->c_str(), backend_name) == 0) {
236237
return true;
237238
}
238239
}

0 commit comments

Comments
 (0)