From e2bfd9e3b22e41b1f0e95bbe5e2e383f44a15685 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 6 Jun 2016 17:17:18 +0100 Subject: [PATCH] Diagnose empty selection desc string Fixes #690 --- src/selection.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/selection.cc b/src/selection.cc index ee849bc4..81d2c051 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -594,6 +594,9 @@ Selection selection_from_string(StringView desc) SelectionList selection_list_from_string(Buffer& buffer, StringView desc) { + if (desc.empty()) + throw runtime_error{"empty selection description"}; + Vector sels; for (auto sel_desc : desc | split(':')) sels.push_back(selection_from_string(sel_desc));