Skip to content

Commit 8652376

Browse files
authored
Avoid nullptr member function call if key hasn't been found by hash_buffer_impl::find_element_ref_with_key (#1800)
1 parent 9f3ae90 commit 8652376

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/oneapi/tbb/detail/_flow_graph_tagged_buffer_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005-2024 Intel Corporation
2+
Copyright (c) 2005-2025 Intel Corporation
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -303,7 +303,7 @@ class hash_buffer_impl : public HashCompare {
303303
bool find_ref_with_key(const Knoref& k, pointer_type &v) {
304304
element_type* element_ptr = nullptr;
305305
bool res = find_element_ref_with_key(k, element_ptr);
306-
v = element_ptr->get_value_ptr();
306+
if(res) v = element_ptr->get_value_ptr();
307307
return res;
308308
}
309309

0 commit comments

Comments
 (0)