summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_selection.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/time_selection.cc')
-rw-r--r--gtk2_ardour/time_selection.cc4
1 files changed, 4 insertions, 0 deletions
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;
}