1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix fatal in browse file if lintCommit is invalid

Test Plan: Set `lintCommit` to 'x' and browsed a file.

Reviewers: nh, epriestley

Reviewed By: nh

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3976
This commit is contained in:
vrana 2012-11-16 18:17:18 -08:00
parent 874fb9b6d9
commit b29dfe436e

View file

@ -137,8 +137,13 @@ final class DiffusionBrowseFileController extends DiffusionController {
$lint_request = clone $drequest;
$lint_request->setCommit($branch->getLintCommit());
$lint_history = DiffusionHistoryQuery::newFromDiffusionRequest(
$lint_request)->setLimit(1)->loadHistory();
try {
$lint_history = DiffusionHistoryQuery::newFromDiffusionRequest(
$lint_request)->setLimit(1)->loadHistory();
} catch (Exception $ex) {
// This can happen if lintCommit is invalid.
$lint_history = null;
}
$this->lintCommit = '';
if (!$file_history || !$lint_history ||