Merge lp:~aacid/unity-greeter/check_remote_fields_before_use into lp:unity-greeter

Proposed by Albert Astals Cid
Status: Merged
Merged at revision: 522
Proposed branch: lp:~aacid/unity-greeter/check_remote_fields_before_use
Merge into: lp:unity-greeter
Diff against target: 21 lines (+11/-0)
1 file modified
src/user-list.vala (+11/-0)
To merge this branch: bzr merge lp:~aacid/unity-greeter/check_remote_fields_before_use
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Review via email: mp+120983@code.launchpad.net

Commit message

Check the fields are there, it'd be rare but it can happen if r-l-s sends us wrong data

Description of the change

Check the fields are there, it'd be rare but it can happen if r-l-s sends us wrong data

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/user-list.vala'
2--- src/user-list.vala 2012-08-22 14:24:18 +0000
3+++ src/user-list.vala 2012-08-23 12:55:23 +0000
4@@ -333,6 +333,17 @@
5
6 DashEntry password_field = current_remote_fields.get("password") as DashEntry;
7 Gtk.Entry email_field = current_remote_fields.get("email") as Gtk.Entry;
8+ if (password_field == null)
9+ {
10+ debug("Something wrong happened in remote_directory_respond_cb. There was no password field");
11+ return;
12+ }
13+ if (email_field == null)
14+ {
15+ debug("Something wrong happened in remote_directory_respond_cb. There was no email field");
16+ return;
17+ }
18+
19 RemoteServer[] server_list = {};
20 string email = email_field.text;
21 bool email_valid = false;

Subscribers

People subscribed via source and target branches