[regression-ish] When a recurring contribution template has no line items, the contact contribution tab crashes
Overview
There are some contributions that don't have line items. I suspect that shouldn't be, but I found at least a couple in every database I checked.
Now, with PR #20784, if you have a recurring contribution, and the template (pseudo-template, I suppose) contribution has no line items, it causes a 500 error:
PHP Fatal error: Uncaught TypeError: Return value of CRM_Financial_BAO_Order::getPriceSetID() must be of the type int, null returned in /var/www/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Financial/BAO/Order.php:455"
Stack trace:"
#0 /var/www/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/ContributionRecur.php(557): CRM_Financial_BAO_Order->getPriceSetID()"
#1 /var/www/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Page/Tab.php(61): CRM_Contribute_BAO_ContributionRecur::getTemplateContribution(632)"
#2 /var/www/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Page/Tab.php(324): CRM_Contribute_Page_Tab::recurLinks(632)"
#3 /var/www/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Page/Tab.php(288): CRM_Contribute_Page_Tab->buildRecurringContributionsArray(Array)"
#4 /var/www/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Page/Tab.php(256): CRM_Contri..."
So while this is technically a regression, it's more of a data error - but it seems like a fairly widespread data error.