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:
parent
874fb9b6d9
commit
b29dfe436e
1 changed files with 7 additions and 2 deletions
|
@ -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 ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue