From f342714430c2102d0edf41ed8f019952d939d97a Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Sun, 3 Nov 2019 15:29:54 +0100 Subject: [PATCH] Fix error when there are no products --- views/products.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/products.pl b/views/products.pl index 09b4de5..6fa150b 100644 --- a/views/products.pl +++ b/views/products.pl @@ -36,7 +36,7 @@ cart([Name|Items]) --> products_view(_Request) :- http_session_id(SessionId), - bagof(product(X, Y), product(X, Y), Products), + (bagof(product(X, Y), product(X, Y), Products); Products = []), (bagof(Name, cart_entry(SessionId, Name), CartEntries); CartEntries = []), reply_html_page( [