Skip to content

Commit b4e15a9

Browse files
committed
Fixed: don't assume API token is valid when getting the tracker configuration.
1 parent 74c726d commit b4e15a9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ public function get_tracker_id() {
184184

185185
if ( ! $id ) {
186186
$tracker_configuration = $this->get_configuration();
187-
$id = $tracker_configuration->getId();
187+
188+
if ( ! $tracker_configuration instanceof Client\Model\TrackerScriptConfigurationTrackerScriptConfiguration ) {
189+
return '';
190+
}
191+
192+
$id = $tracker_configuration->getId();
188193

189194
update_option( 'plausible_analytics_tracker_id', $id );
190195
}

0 commit comments

Comments
 (0)