1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-02 01:48:23 +01: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 = clone $drequest;
$lint_request->setCommit($branch->getLintCommit()); $lint_request->setCommit($branch->getLintCommit());
$lint_history = DiffusionHistoryQuery::newFromDiffusionRequest( try {
$lint_request)->setLimit(1)->loadHistory(); $lint_history = DiffusionHistoryQuery::newFromDiffusionRequest(
$lint_request)->setLimit(1)->loadHistory();
} catch (Exception $ex) {
// This can happen if lintCommit is invalid.
$lint_history = null;
}
$this->lintCommit = ''; $this->lintCommit = '';
if (!$file_history || !$lint_history || if (!$file_history || !$lint_history ||