From 20ecb64c134db1af6d19e9992849ff1c00ce45ed Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 2 Nov 2018 14:48:51 -0400 Subject: [PATCH] Don't attempt to migrate an empty table --- includes/schema.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/schema.php b/includes/schema.php index f92ddf3..26e7067 100644 --- a/includes/schema.php +++ b/includes/schema.php @@ -229,6 +229,9 @@ function migration_1_2_0() { "SELECT activitypub_id, object FROM {$wpdb->prefix}pterotype_objects", OBJECT_K ); + if ( ! $objects || empty( $objects ) ) { + return; + } $ids_to_urls = array_map( function( $row ) { $json = \json_decode( $row->object, true );