mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2024-12-14 11:58:02 +00:00
fix(test): Don't access null pointer (#2126)
This caused a UBSan warning to be printed in test `DflyEngineTest.Bug207` ``` /usr/include/c++/11/bits/stl_vector.h:1046:34: runtime error: reference binding to null pointer of type 'struct value_type' ```
This commit is contained in:
parent
2baadd1e90
commit
b9781c4903
1 changed files with 6 additions and 3 deletions
|
@ -1183,9 +1183,12 @@ finish:
|
|||
// send the deletion to the replicas.
|
||||
// fiber preemption could happen in this phase.
|
||||
vector<string_view> args(keys_to_journal.begin(), keys_to_journal.end());
|
||||
ArgSlice delete_args(&args[0], args.size());
|
||||
if (auto journal = owner_->journal(); journal) {
|
||||
journal->RecordEntry(0, journal::Op::EXPIRED, db_ind, 1, make_pair("DEL", delete_args), false);
|
||||
if (!args.empty()) {
|
||||
ArgSlice delete_args(&args[0], args.size());
|
||||
if (auto journal = owner_->journal(); journal) {
|
||||
journal->RecordEntry(0, journal::Op::EXPIRED, db_ind, 1, make_pair("DEL", delete_args),
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
auto time_finish = absl::GetCurrentTimeNanos();
|
||||
|
|
Loading…
Reference in a new issue