diff --git a/booking.helper.inc b/booking.helper.inc index 375af2b..2be71f5 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -1393,8 +1393,11 @@ function _booking_details_email_summary($node) { //look up the actual code since the booking_person node available at this time only has the primary key for that table $earlyaccess_query = db_query("SELECT booking_earlyaccess_code FROM {booking_earlyaccess_codes} where cid = :code", array(':code' => $node->booking_earlyaccess_code_id)) - ->fetchObject(); - $rows[] = t('Early Access Code: !code', array('!code' => $earlyaccess_query->booking_earlyaccess_code)); + ->fetchObject(); + //only add the row if there was a result returned + if ($earlyaccess_query) { + $rows[] = t('Early Access Code: !code', array('!code' => $earlyaccess_query->booking_earlyaccess_code)); + } } /*