Skip to content

Commit

Permalink
Fix PHP Fatal error when SyncProgress started_at is not set
Browse files Browse the repository at this point in the history
- PHP Warning: Trying to access array offset on value of type null
- PHP Fatal error: Uncaught TypeError: MedusaWP\Models\SyncProgress::count_troubleshoot_messages(): Argument #1 ($sync_timestamp) must be of type int, null given
  • Loading branch information
anamarijapapic committed Apr 2, 2024
1 parent 261c99c commit f1f5489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wordpress-plugin/src/Routes/Admin/MedusaBulkSync.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public function get_sync_progress() {
*/
public function get_sync_progress_messages( $req ) {
$progress = Settings::get_sync_progress();
$sync_timestamp = $progress['started_at'];
$sync_timestamp = isset( $progress['started_at'] ) ? $progress['started_at'] : time();

$params = $req->get_params();

Expand Down

0 comments on commit f1f5489

Please sign in to comment.