From 08ff4d628b3a672b0ebfa556c2d5effb81483366 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 14 Sep 2018 23:59:20 +0200 Subject: [PATCH] Only attempt to show receipts if there are any. Previously "Receipts:" was still shown. --- CMakeLists.txt | 2 +- src/interface_text.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bcf0fb..bbb2455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (whyblocked - VERSION 0.6.1 + VERSION 0.6.2 LANGUAGES CXX ) diff --git a/src/interface_text.cpp b/src/interface_text.cpp index e739c22..f295879 100644 --- a/src/interface_text.cpp +++ b/src/interface_text.cpp @@ -151,10 +151,13 @@ const bool whyblocked_text::start() } cout << std::get<1>(result) << '\n'; - cout << "Receipts:\n"; - for (const string &url : std::get<2>(result)) + if (!std::get<2>(result).empty()) { - cout << " " << url << '\n'; + cout << "Receipts:\n"; + for (const string &url : std::get<2>(result)) + { + cout << " " << url << '\n'; + } } } }