gnucash stable: Bug 798982 - GetQuotes crashes if Finance::Quote returns an empty date.

John Ralls jralls at code.gnucash.org
Sat Jul 8 19:48:18 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/133ac886 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e20f6036 (commit)



commit 133ac886189edf23b78c53679aac741865892011
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jul 8 16:47:14 2023 -0700

    Bug 798982 - GetQuotes crashes if Finance::Quote returns an empty date.
    
    Don't try to construct a date from an empty string.

diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp
index 8ef7c4597c..4c40253f30 100644
--- a/libgnucash/app-utils/gnc-quotes.cpp
+++ b/libgnucash/app-utils/gnc-quotes.cpp
@@ -584,7 +584,7 @@ calc_price_time(const PriceParams& p)
      * as gnucash insists on having a valid format". It's also wrong,
      * as it lacks seconds. Best ignored.
      */
-    if (p.date)
+    if (p.date && !p.date->empty())
     {
         try
         {



Summary of changes:
 libgnucash/app-utils/gnc-quotes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list