Adapt to upstream change in reviewer suggestion result

Previously the result would contain a list of maps, where the maps
would have entries with the key being either "account" or "group"
and the value being AccountInfo or GroupBaseInfo. Both of the Info
classes have a 'name' member.

Since change Id1323c5a0 the maps may also include an integer 'count'
and boolean 'confirm'. Calling get('name') on those returns null, and
then the subsequent call to 'toString()' fails.

Move the calls to get('name') into the conditional blocks where we
know the item is AccountInfo or GroupBaseInfo.

Bug: Issue 7008
Change-Id: Ic00927eb2e9c86efc71452289c89aaff702ba07e
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewers/client/ReviewerSuggestOracle.java b/src/main/java/com/googlesource/gerrit/plugins/reviewers/client/ReviewerSuggestOracle.java
index 2f601dc..8bb7556 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewers/client/ReviewerSuggestOracle.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewers/client/ReviewerSuggestOracle.java
@@ -92,13 +92,14 @@
               NativeMap<JavaScriptObject> map1 = result.get(key0).cast();
               for (String key1 : keys1) {
                 NativeMap<JavaScriptObject> map2 = map1.get(key1).cast();
-                String name = map2.get(NAME_KEY).toString();
                 if (ACCOUNT_KEY.equals(key1)) {
+                  String name = map2.get(NAME_KEY).toString();
                   String email =
                       (map2.containsKey(EMAIL_KEY)) ? map2.get(EMAIL_KEY).toString() : "";
                   String accountId = map2.get(ACCOUNT_ID_KEY).toString();
                   suggestions.add(new ReviewerSuggestion(req.getQuery(), name, email, accountId));
                 } else if (GROUP_KEY.equals(key1)) {
+                  String name = map2.get(NAME_KEY).toString();
                   suggestions.add(new ReviewerSuggestion(req.getQuery(), name));
                 }
               }