aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-11-29 23:54:10 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-11-29 23:54:10 +0000
commit0d3ff4c44d9934db94e00e9cb0bec5f319d35f3d (patch)
tree86e869b08653a89a4af9e176c89b0c67c909989d
parentd8b45669c24a64ea30d98c870d067a1b3311db2c (diff)
downloadpaludis-0d3ff4c44d9934db94e00e9cb0bec5f319d35f3d.tar.gz
paludis-0d3ff4c44d9934db94e00e9cb0bec5f319d35f3d.tar.xz
Check for null failures
-rw-r--r--src/clients/accerso/accerso.cc39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 98a1985..e556229 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -150,28 +150,33 @@ main(int argc, char *argv[])
}
catch (const FetchActionError & e)
{
- for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ; f != f_end ; ++f)
+ if (e.failures())
{
- std::string r;
- if ((*f).requires_manual_fetching())
- r = "manual";
-
- if ((*f).failed_automatic_fetching())
+ for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ; f != f_end ; ++f)
{
- if (! r.empty())
- r.append(", ");
- r.append("could not fetch");
- }
+ std::string r;
+ if ((*f).requires_manual_fetching())
+ r = "manual";
- if (! (*f).failed_integrity_checks().empty())
- {
- if (! r.empty())
- r.append(", ");
- r.append((*f).failed_integrity_checks());
- }
+ if ((*f).failed_automatic_fetching())
+ {
+ if (! r.empty())
+ r.append(", ");
+ r.append("could not fetch");
+ }
- results.insert(std::make_pair(*i, (*f).target_file() + ": " + r));
+ if (! (*f).failed_integrity_checks().empty())
+ {
+ if (! r.empty())
+ r.append(", ");
+ r.append((*f).failed_integrity_checks());
+ }
+
+ results.insert(std::make_pair(*i, (*f).target_file() + ": " + r));
+ }
}
+ else
+ results.insert(std::make_pair(*i, "Unknown fetch error"));
}
catch (const InternalError &)
{