X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_selection.cc;h=a0f33e8c99fd0db7aabe36275e8d3799a46e03f7;hb=89b0beb2ddf002e8d95ad89148e2c7e395294b0c;hp=419d82dbccfde06c06c0c9788803f3ea573538f3;hpb=6fa6514cfdb0ce38d93b51197f599dfd091bad1d;p=ardour.git diff --git a/gtk2_ardour/time_selection.cc b/gtk2_ardour/time_selection.cc index 419d82dbcc..a0f33e8c99 100644 --- a/gtk2_ardour/time_selection.cc +++ b/gtk2_ardour/time_selection.cc @@ -103,5 +103,9 @@ TimeSelection::end_frame () framecnt_t TimeSelection::length() { + if (empty()) { + return 0; + } + return end_frame() - start() + 1; }