lib: When matching an account query against a posting, don't try to

match against the same posting twice, in cases when poriginal is
Nothing.
This commit is contained in:
Stephen Morgan 2021-05-05 14:50:58 +10:00 committed by Simon Michael
parent 7abf8eedd5
commit 6c2ab5c940

View File

@ -608,7 +608,7 @@ matchesPosting (Or qs) p = any (`matchesPosting` p) qs
matchesPosting (And qs) p = all (`matchesPosting` p) qs
matchesPosting (Code r) p = maybe False (regexMatchText r . tcode) $ ptransaction p
matchesPosting (Desc r) p = maybe False (regexMatchText r . tdescription) $ ptransaction p
matchesPosting (Acct r) p = matches p || matches (originalPosting p)
matchesPosting (Acct r) p = matches p || maybe False matches (poriginal p)
where matches = regexMatchText r . paccount
matchesPosting (Date span) p = span `spanContainsDate` postingDate p
matchesPosting (Date2 span) p = span `spanContainsDate` postingDate2 p