@@ -179,25 +179,29 @@ public static Object createRecentList(List<RecentContact> recents, int unreadNum
179179 }
180180 map .putString ("time" , TimeUtil .getTimeShowString (contact .getTime (), true ));
181181
182- String fromNick = "" ;
183- try {
184- fromNick = contact .getFromNick ();
185- } catch (Exception e ) {
186- e .printStackTrace ();
187- }
188182
189- fromNick = TextUtils .isEmpty (fromNick ) ? NimUserInfoCache .getInstance ().getUserDisplayName (fromAccount ) : fromNick ;
190- map .putString ("nick" , fromNick );
183+ String fromNick = "" ;
191184 String teamNick = "" ;
192- if (contact .getSessionType () == SessionTypeEnum .Team && !TextUtils .equals (LoginService .getInstance ().getAccount (), fromAccount )) {
193- String tid = contact .getContactId ();
194- teamNick = getTeamUserDisplayName (tid , fromAccount )+": " ;
195- if ((contact .getAttachment () instanceof NotificationAttachment )) {
196- if (AitHelper .hasAitExtention (contact )) {
197- if (contact .getUnreadCount () == 0 ) {
198- AitHelper .clearRecentContactAited (contact );
199- } else {
200- content = AitHelper .getAitAlertString (content );
185+ if (!TextUtils .isEmpty (fromAccount )) {
186+ try {
187+ fromNick = contact .getFromNick ();
188+ } catch (Exception e ) {
189+ e .printStackTrace ();
190+ }
191+
192+ fromNick = TextUtils .isEmpty (fromNick ) ? NimUserInfoCache .getInstance ().getUserDisplayName (fromAccount ) : fromNick ;
193+ map .putString ("nick" , fromNick );
194+
195+ if (contact .getSessionType () == SessionTypeEnum .Team && !TextUtils .equals (LoginService .getInstance ().getAccount (), fromAccount )) {
196+ String tid = contact .getContactId ();
197+ teamNick = TextUtils .isEmpty (fromAccount ) ? "" : getTeamUserDisplayName (tid , fromAccount ) + ": " ;
198+ if ((contact .getAttachment () instanceof NotificationAttachment )) {
199+ if (AitHelper .hasAitExtention (contact )) {
200+ if (contact .getUnreadCount () == 0 ) {
201+ AitHelper .clearRecentContactAited (contact );
202+ } else {
203+ content = AitHelper .getAitAlertString (content );
204+ }
201205 }
202206 }
203207 }
0 commit comments