mirror of
https://github.com/tstack/lnav.git
synced 2024-10-26 13:16:11 +03:00
[lss] handle invalid row number
This commit is contained in:
parent
d8b7dc40db
commit
6fdb56cd4e
1
.github/workflows/bins.yml
vendored
1
.github/workflows/bins.yml
vendored
@ -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…
Reference in New Issue
Block a user