From ad87f72cfdc30dc6e94c3fdb7e72ff67ce7552aa Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Sun, 8 Sep 2019 18:45:44 +0200 Subject: Inkview: show error message if there are no valid files and exit --- src/inkview-window.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/inkview-window.cpp') diff --git a/src/inkview-window.cpp b/src/inkview-window.cpp index 05893dc9b..57e7f4727 100644 --- a/src/inkview-window.cpp +++ b/src/inkview-window.cpp @@ -49,6 +49,10 @@ InkviewWindow::InkviewWindow(const Gio::Application::type_vec_files files, preload_documents(); } + if (_files.empty()) { + throw NoValidFilesException(); + } + _documents.resize( _files.size(), nullptr); // We keep _documents and _files in sync. // Callbacks @@ -278,7 +282,7 @@ InkviewWindow::show_control() return; } - + builder->get_widget("ControlWindow", _controlwindow); if (!_controlwindow) { std::cerr << "InkviewWindow::show_control: Control Window not found!" << std::endl; -- cgit v1.2.3