1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +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:
Bob Trahan 2013-05-21 13:48:24 -07:00
parent f6b393d529
commit 88fec4908b

View file

@ -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(),