Merge pull request #433 from infosiftr/undefined

Handle completely uninitialized repo descriptions better by explicitly converting undef to "" (avoids warnings about "Use of uninitialized value $currentText")
This commit is contained in:
yosifkit 2015-12-29 14:21:29 -08:00
commit 8b7f3e673b
1 changed files with 2 additions and 0 deletions

View File

@ -118,6 +118,8 @@ while (my $repo = shift) { # '/library/hylang', '/tianon/perl', etc
warn 'failed to get: ' . $repoUrl and next unless $repoTx->success; warn 'failed to get: ' . $repoUrl and next unless $repoTx->success;
my $repoDetails = $repoTx->res->json; my $repoDetails = $repoTx->res->json;
$repoDetails->{description} //= '';
$repoDetails->{full_description} //= '';
my $hubShort = prompt_for_edit($repoDetails->{description}, $repoName . '/README-short.txt'); my $hubShort = prompt_for_edit($repoDetails->{description}, $repoName . '/README-short.txt');
my $hubLong = prompt_for_edit($repoDetails->{full_description}, $repoName . '/README.md', $hubLengthLimit); my $hubLong = prompt_for_edit($repoDetails->{full_description}, $repoName . '/README.md', $hubLengthLimit);