Prevent throw in gnc-pricedb.

If a price lookup is given an invalid time64/timespec (i.e. INT64_MAX)
then just return NULL instead of trying to find the nearest price.
This commit is contained in:
John Ralls 2018-04-12 15:15:33 -07:00
parent 16ba1e39b1
commit 85cc574d50

View File

@ -2348,6 +2348,7 @@ lookup_nearest_in_time(GNCPriceDB *db,
GList *item = NULL;
if (!db || !c || !currency) return NULL;
if (t.tv_sec == INT64_MAX) return NULL;
ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
price_list = pricedb_get_prices_internal (db, c, currency, TRUE);
if (!price_list) return NULL;