Don't attempt to migrate an empty table

This commit is contained in:
Jeremy Dormitzer 2018-11-02 14:48:51 -04:00
parent cad049391b
commit 20ecb64c13
No known key found for this signature in database
GPG Key ID: 106FF4BA83EE8202

View File

@ -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 );