diff --git a/scripts/migrate-szuru1.php b/scripts/migrate-szuru1.php index f4fa7a42..203cd9f5 100644 --- a/scripts/migrate-szuru1.php +++ b/scripts/migrate-szuru1.php @@ -411,6 +411,11 @@ class CopyCommentsTask extends SourcePdoTask $commentDao = Injector::get(CommentDao::class); $this->commitInChunks($this->sourcePdo->query('SELECT * FROM comment'), function($arr) use ($commentDao) { + if (!$arr['post_id']) + { + $this->warn('Missing ID for comment #' . $arr['id']); + return; + } $comment = new Comment(); $comment->setPostId($arr['post_id']); $comment->setUserId($arr['commenter_id']);