[gnome-contacts] Handle null returns from get_parameter_values
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] Handle null returns from get_parameter_values
- Date: Tue, 6 Sep 2011 14:19:19 +0000 (UTC)
commit 55d2077f8e11ac09a82183904603a4cf3c4be8be
Author: Alexander Larsson <alexl redhat com>
Date: Tue Sep 6 16:18:44 2011 +0200
Handle null returns from get_parameter_values
src/contacts-contact-pane.vala | 36 +++++++++++++++++++++---------------
1 files changed, 21 insertions(+), 15 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index c04895d..ecda365 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -1451,11 +1451,13 @@ public class Contacts.ContactPane : Grid {
fields_layout.add_detail (role.organisation_name);
}
var org_units = role_detail.get_parameter_values ("org_unit");
- foreach (var org_unit in org_units) {
- if (org_unit != null &&
- org_unit != "") {
- fields_layout.add_label (_("Department"));
- fields_layout.add_detail (org_unit);
+ if (org_units != null) {
+ foreach (var org_unit in org_units) {
+ if (org_unit != null &&
+ org_unit != "") {
+ fields_layout.add_label (_("Department"));
+ fields_layout.add_detail (org_unit);
+ }
}
}
if (role.role != null &&
@@ -1469,19 +1471,23 @@ public class Contacts.ContactPane : Grid {
fields_layout.add_detail (role.title);
}
var managers = role_detail.get_parameter_values ("manager");
- foreach (var manager in managers) {
- if (manager != null &&
- manager != "") {
- fields_layout.add_label (_("Manager"));
- fields_layout.add_detail (manager);
+ if (managers != null) {
+ foreach (var manager in managers) {
+ if (manager != null &&
+ manager != "") {
+ fields_layout.add_label (_("Manager"));
+ fields_layout.add_detail (manager);
+ }
}
}
var assistants = role_detail.get_parameter_values ("assistant");
- foreach (var assistant in assistants) {
- if (assistant != null &&
- assistant != "") {
- fields_layout.add_label (_("Assistant"));
- fields_layout.add_detail (assistant);
+ if (assistants != null) {
+ foreach (var assistant in assistants) {
+ if (assistant != null &&
+ assistant != "") {
+ fields_layout.add_label (_("Assistant"));
+ fields_layout.add_detail (assistant);
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]