Here's the line that's causing the error:
if ($alias && $startPageId == $archiveId) {
It's throwing an error because, as far as I can tell, $startPageId is never set. This may or may not be the cause of your issue.
The first thing I'd try is putting this line just above the problem line in the core/components/articles/model/articles/articlesrouter.class.php file.
$startPageId = 12; // change 12 to the ID of your first article
If that doesn't work, you can eliminate the error by commenting out this section:
if ($alias && $startPageId == $archiveId) {
$startPageResId = $archiveId;
if (isset($archive[1])) $startPagePrefix = $archive[1];
}
Like this:
/*
if ($alias && $startPageId == $archiveId) {
$startPageResId = $archiveId;
if (isset($archive[1])) $startPagePrefix = $archive[1];
}
*/
Since $startPageId is never set, it's unlikely to equal $archiveId, so the code it probably not executing anyway.