[lss] handle invalid row number

pull/1205/head
Tim Stack 9 months ago
parent d8b7dc40db
commit 6fdb56cd4e

@ -67,6 +67,7 @@ jobs:
build-arm:
runs-on: ubuntu-latest
if: ${{ inputs.lnav_version_number != '' }}
strategy:
matrix:
include:

@ -479,7 +479,7 @@ public:
nonstd::optional<struct timeval> time_for_row(vis_line_t row)
{
if (row < (ssize_t) this->text_line_count()) {
if (row >= 0_vl && row < (ssize_t) this->text_line_count()) {
return this->find_line(this->at(row))->get_timeval();
}
return nonstd::nullopt;

@ -832,7 +832,9 @@ text_time_translator::data_reloaded(textview_curses* tc)
if (tc->get_inner_height() == 0) {
return;
}
if (tc->get_selection() > tc->get_inner_height()) {
if (tc->get_selection() < 0_vl
|| tc->get_selection() > tc->get_inner_height())
{
if (this->ttt_top_time.tv_sec != 0) {
this->row_for_time(this->ttt_top_time) |
[tc](auto new_top) { tc->set_selection(new_top); };

Loading…
Cancel
Save