Skip to content

Commit

Permalink
added rerror for invalid range
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Dec 14, 2024
1 parent aee6422 commit 0581310
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/clp_ffi_js/ir/StreamReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <clp/type_utils.hpp>
#include <emscripten/em_asm.h>
#include <emscripten/val.h>
#include <spdlog/spdlog.h>

#include <clp_ffi_js/constants.hpp>
#include <clp_ffi_js/ir/LogEventWithFilterData.hpp>
Expand Down Expand Up @@ -195,6 +196,7 @@ auto StreamReader::generic_decode_range(
length = log_events.size();
}
if (length < end_idx || begin_idx > end_idx) {
SPDLOG_ERROR("Invalid log event index range: {}-{}", begin_idx, end_idx);
return DecodedResultsTsType{emscripten::val::null()};
}

Expand Down

0 comments on commit 0581310

Please sign in to comment.