early exit
commit54706e533e8535019f7360c76688e44c1f964bb0
authorMichael Terry <michael.terry@canonical.com>
dateWed 8 Jun 2016, 16:05 (10 years ago)
parente4b3050
qml/Greeter/Greeter.qml+4
@@ -133,12 +133,16 @@ Showable {
133133 }
134134
135135 function getUserIndex(username) {
136+ if (username === "")
137+ return -1;
138+
136139 // Find index for requested user, if it exists
137140 for (var i = 0; i < LightDMService.users.count; i++) {
138141 if (username === LightDMService.users.data(i, LightDMService.userRoles.NameRole)) {
139142 return i;
140143 }
141144 }
145+
142146 return -1;
143147 }
144148