1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 04:42:40 +01:00

Fail more softly on funky arcanist project / symbol data

Summary: Fixes T8240, probably?

Test Plan: This is hard to test locally post-migration -- @btrahan, does it fix things for you?

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: btrahan, epriestley

Maniphest Tasks: T8240

Differential Revision: https://secure.phabricator.com/D12903
This commit is contained in:
epriestley 2015-05-18 10:26:53 -07:00
parent 021223907d
commit 44cf60dfd2

View file

@ -38,7 +38,12 @@ foreach ($raw_projects_data as $project_row) {
idx($project_row, 'name', '???')); idx($project_row, 'name', '???'));
$symbol_index_projects = $project_row['symbolIndexProjects']; $symbol_index_projects = $project_row['symbolIndexProjects'];
$symbol_index_projects = nonempty($symbol_index_projects, '[]');
try {
$symbol_index_projects = phutil_json_decode($symbol_index_projects); $symbol_index_projects = phutil_json_decode($symbol_index_projects);
} catch (PhutilJSONParserException $ex) {
continue;
}
$sources = $repo->getDetail('symbol-sources', array()); $sources = $repo->getDetail('symbol-sources', array());
foreach ($symbol_index_projects as $index_project) { foreach ($symbol_index_projects as $index_project) {
@ -50,7 +55,12 @@ foreach ($raw_projects_data as $project_row) {
$repo->setDetail('symbol-sources', $sources); $repo->setDetail('symbol-sources', $sources);
$languages = $project_row['symbolIndexLanguages']; $languages = $project_row['symbolIndexLanguages'];
$languages = nonempty($languages, '[]');
try {
$languages = phutil_json_decode($languages); $languages = phutil_json_decode($languages);
} catch (PhutilJSONParserException $ex) {
continue;
}
$languages = array_merge( $languages = array_merge(
$repo->getDetail('symbol-languages', array()), $repo->getDetail('symbol-languages', array()),