diff --git a/includes/ThreadItemStore.php b/includes/ThreadItemStore.php index 2de01f93f..dcc9c0c45 100644 --- a/includes/ThreadItemStore.php +++ b/includes/ThreadItemStore.php @@ -416,7 +416,7 @@ class ThreadItemStore { ->ignore() ->caller( $method ) ->execute(); - return $dbw->insertId(); + return $dbw->affectedRows() ? $dbw->insertId() : null; }, $didInsert ); @@ -453,7 +453,7 @@ class ThreadItemStore { ->ignore() ->caller( $method ) ->execute(); - return $dbw->insertId(); + return $dbw->affectedRows() ? $dbw->insertId() : null; }, $didInsert ); @@ -613,7 +613,7 @@ class ThreadItemStore { ->ignore() ->caller( $method ) ->execute(); - return $dbw->insertId(); + return $dbw->affectedRows() ? $dbw->insertId() : null; }, $didInsert );