Skip to content
Snippets Groups Projects
Commit d20c7e8f authored by Rich Lott / Artful Robot's avatar Rich Lott / Artful Robot Committed by mattwire
Browse files

Fix issue in stripe_civicrm_post where a not-yet loaded contact_id, causes crash.

parent 6491d1a9
No related branches found
Tags 1.0.1
No related merge requests found
Pipeline #1395 skipped
...@@ -245,7 +245,13 @@ function stripe_civicrm_post($op, $objectName, $objectId, &$objectRef) { ...@@ -245,7 +245,13 @@ function stripe_civicrm_post($op, $objectName, $objectId, &$objectRef) {
case 'Email': case 'Email':
if (in_array($op, ['create', 'edit'])) { if (in_array($op, ['create', 'edit'])) {
register_shutdown_function('stripe_civicrm_shutdown_updatestripecustomer', $objectRef->contact_id); if ($objectRef->N == 0) {
// Object may not be loaded; may not have contact_id available yet.
$objectRef->find(TRUE);
}
if ($objectRef->contact_id) {
register_shutdown_function('stripe_civicrm_shutdown_updatestripecustomer', $objectRef->contact_id);
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment