Java 无法获取用户';s在QuickBlox android中的个人资料图片

Java 无法获取用户';s在QuickBlox android中的个人资料图片,java,quickblox,quickblox-android,chatsdk,Java,Quickblox,Quickblox Android,Chatsdk,我正在使用QuickBlox聊天,工作正常,但我无法获得用户的个人资料图片 当获取配置文件时,它会给出空指针例外,我的代码如下 Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference final QBUser user = new QBUser(); user.setId(qbChatDialogs.get(position).getOccup

我正在使用QuickBlox聊天,工作正常,但我无法获得用户的个人资料图片 当获取配置文件时,它会给出空指针例外,我的代码如下

Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference

 final QBUser user = new QBUser();
        user.setId(qbChatDialogs.get(position).getOccupants().get(1));
        Log.e("TAG", "onBindViewHolder: " + user);
        Log.e("TAG", "onBindViewHolder: " + qbChatDialogs.get(position).getOccupants().get(1));
        int userAvatarID = user.getFileId();// here is exception.////////////
        QBContent.downloadFileById(userAvatarID, new QBProgressCallback() {
            @Override
            public void onProgressUpdate(int i) {
                // do something to show progress if needed
            }
        }).performAsync(new QBEntityCallback<InputStream>() {
            @Override
            public void onSuccess(InputStream inputStream, Bundle bundle) {
                Log.e("TAG", "onSuccess: " + inputStream + "    " + bundle);
                // Receiving input stream
                // Just write an InputStream to a file and show it
            }

            @Override
            public void onError(QBResponseException e) {
                Log.e("TAG", "onError: " + e.getMessage());
            }
        });
尝试对空对象引用调用虚拟方法“int java.lang.Integer.intValue()”
最终QBUser用户=新QBUser();
user.setId(qbChatDialogs.get(position.getAccounters().get(1));
Log.e(“标签”,“onBindViewHolder:”+用户);
Log.e(“TAG”,“onBindViewHolder:”+qbChatDialogs.get(position).getAccounters().get(1));
int userAvatarID=user.getFileId();//这是一个例外////////////
下载FileById(userAvatarID,新的QBProgressCallback(){
@凌驾
公共void onProgressUpdate(int i){
//如果需要的话,做一些事情来展示进步
}
}).performAsync(新的QBEntityCallback(){
@凌驾
成功时公共无效(InputStream InputStream、捆绑包){
Log.e(“TAG”、“onSuccess:+inputStream+”“+bundle”);
//接收输入流
//只需将InputStream写入文件并显示它
}
@凌驾
公共无效报告人(QBResponseException e){
Log.e(“TAG”,“onError:+e.getMessage());
}
});