# HG changeset patch # User Da Risk # Date 1315207882 -7200 # Node ID c82293948d2fbd7f2441f584114621c226d1464a # Parent 6e5999172eb12b87d8d478b23b3f3906238521b7 Fix a NullPointerException in ChangeStatus. diff -r 6e5999172eb1 -r c82293948d2f src/com/beem/project/beem/service/XmppConnectionAdapter.java --- a/src/com/beem/project/beem/service/XmppConnectionAdapter.java Thu Aug 25 14:51:07 2011 +0200 +++ b/src/com/beem/project/beem/service/XmppConnectionAdapter.java Mon Sep 05 09:31:22 2011 +0200 @@ -417,7 +417,7 @@ /** * Get the user informations. * - * @return the user infos + * @return the user infos or null if not logged */ public UserInfo getUserInfo() { return mUserInfo; diff -r 6e5999172eb1 -r c82293948d2f src/com/beem/project/beem/service/aidl/IXmppFacade.aidl --- a/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Thu Aug 25 14:51:07 2011 +0200 +++ b/src/com/beem/project/beem/service/aidl/IXmppFacade.aidl Mon Sep 05 09:31:22 2011 +0200 @@ -103,6 +103,10 @@ void disableAvatarPublishing(); + /** + * Get the user informations. + * @return null if not connected + */ UserInfo getUserInfo(); IPrivacyListManager getPrivacyListManager(); diff -r 6e5999172eb1 -r c82293948d2f src/com/beem/project/beem/ui/ChangeStatus.java --- a/src/com/beem/project/beem/ui/ChangeStatus.java Thu Aug 25 14:51:07 2011 +0200 +++ b/src/com/beem/project/beem/ui/ChangeStatus.java Mon Sep 05 09:31:22 2011 +0200 @@ -355,8 +355,10 @@ private void displayCurrentAvatar() { try { UserInfo ui = mXmppFacade.getUserInfo(); + if (ui == null) + return; String avatarId = ui.getAvatarId(); - Log.d(TAG, "User info ; avatar id " + avatarId); + Log.d(TAG, "User info : avatar id " + avatarId); if (avatarId != null) { Uri uri = AvatarProvider.CONTENT_URI.buildUpon().appendPath(avatarId).build(); mAvatar.setImageURI(uri);