From 73139b47a82225f588e877509c338abba0541724 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sat, 8 Feb 2020 14:06:34 -0500 Subject: [PATCH] Condition Sentry reporting on whether or not the configuration is present. Better for people forking the project. --- api/cora/cora.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/cora/cora.php b/api/cora/cora.php index 274fd32..c7a0a4c 100644 --- a/api/cora/cora.php +++ b/api/cora/cora.php @@ -712,7 +712,11 @@ final class cora { // Send data to Sentry for error logging. // https://docs.sentry.io/development/sdk-dev/event-payloads/ - if ($reportable === true && $this->setting->get('environment') === 'live') { + if ( + $reportable === true && + $this->setting->get('sentry_key') !== null && + $this->setting->get('sentry_project_id') !== null + ) { $data = [ 'event_id' => str_replace('-', '', exec('uuidgen -r')), 'timestamp' => date('c'),