I found a TODO which is probably forgotten so I created a task for that here.
if ( is_null( $task ) ) {
//TODO easy form to allow entering of task ID to view task? (Or list of tasks?)
$this->getOutput()->setPageTitle( 'View Task' );
$this->getOutput()->addWikiText( 'No task exists with the id: ' . $taskId );
return;
}