mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Diffusion - double check these sub objects exist before toDictionary'ing them
Summary: wordy title. Ref T3214. Not exactly sure what a valid test is here as the user has a borked setup... Shouldn't fatal though. Test Plan: arc lint Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T3214 Differential Revision: https://secure.phabricator.com/D5995
This commit is contained in:
parent
f6b393d529
commit
88fec4908b
1 changed files with 14 additions and 2 deletions
|
@ -150,11 +150,23 @@ final class DiffusionPathChange {
|
|||
}
|
||||
|
||||
public function toDictionary() {
|
||||
$commit = $this->getCommit();
|
||||
if ($commit) {
|
||||
$commit_dict = $commit->toDictionary();
|
||||
} else {
|
||||
$commit_dict = array();
|
||||
}
|
||||
$commit_data = $this->getCommitData();
|
||||
if ($commit_data) {
|
||||
$commit_data_dict = $commit_data->toDictionary();
|
||||
} else {
|
||||
$commit_data_dict = array();
|
||||
}
|
||||
return array(
|
||||
'path' => $this->getPath(),
|
||||
'commitIdentifier' => $this->getCommitIdentifier(),
|
||||
'commit' => $this->getCommit()->toDictionary(),
|
||||
'commitData' => $this->getCommitData()->toDictionary(),
|
||||
'commit' => $commit_dict,
|
||||
'commitData' => $commit_data_dict,
|
||||
'fileType' => $this->getFileType(),
|
||||
'targetPath' => $this->getTargetPath(),
|
||||
'targetCommitIdentifier' => $this->getTargetCommitIdentifier(),
|
||||
|
|
Loading…
Reference in a new issue