I have tried all i can but still cant solve the problem. i have also received most similar question but all the solution doesn't work. I'm trying to get the images from drawable into the image view, but its causing the application to crash with a null pointer exception
This is my adapter class

```
 public class GroupAdapter extends RecyclerView.Adapter<GroupAdapter.GroupHolder>{

private Context context;
private List<GroupModel> groupList;
GroupModel model;

public GroupAdapter(Context context, List<GroupModel> groupList) {
    this.context = context;
    this.groupList = groupList;
}

@NonNull
@Override
public GroupHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    return new GroupHolder(LayoutInflater.from(parent.getContext())
            .inflate(R.layout.group_item, parent, false));
}

@Override
public void onBindViewHolder(@NonNull GroupHolder holder, int position) {
    final GroupModel groupModel = groupList.get(position);
    holder.setName(groupModel.getName());
    holder.setDesc(groupModel.getDescription());
    holder.setCourse(groupModel.getCourse());
    holder.setOwner(groupModel.getOwner());
    holder.setImage(groupModel.getImage());
    holder.view.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(context, GroupMessage.class);
            context.startActivity(intent);
        }
    });

}

@Override
public int getItemCount() {
    return groupList.size();
}

public class GroupHolder extends RecyclerView.ViewHolder {

private final TextView  name;
private final TextView desc;
private final TextView course;
private final TextView owner;
private final CardView view;

private final ImageView image;

public GroupHolder(View itemView) {
    super(itemView);

            name = (TextView) itemView.findViewById(R.id.textView_grp_name );
            desc = (TextView) itemView.findViewById(R.id.textView_grp_description);
            course = (TextView) itemView.findViewById(R.id.textView_course);
            owner = (TextView) itemView.findViewById(R.id.textView_owner);
            image = (ImageView) itemView.findViewById(R.id.imageView_groups);
            view = (CardView) itemView.findViewById(R.id.group_view);
}

public void setName(String n){
    name.setText(n);
}

public void setDesc(String d){
    desc.setText(d);
}

public void setCourse(String c){
    course.setText(c);
}

public void setOwner(String o){
    owner.setText(o);
}

public void setImage(int i){
   // StorageReference reference = FirebaseStorage.getInstance().getReference().child(i);
    //Glide.with(context).load(reference).into(image);
    image.setImageDrawable(context.getResources().getDrawable(model.getImage()));
}
}
}

```

And this is get image method 

```
 public int getImage() {

    return image;
}

```

and the error

```
  E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.arewagirlcoder.welearn, PID: 13590
java.lang.NullPointerException: Attempt to invoke virtual method 'int com.arewagirlcoder.welearn.GroupModel.getImage()' on a null object reference
    at com.arewagirlcoder.welearn.GroupAdapter$GroupHolder.setImage(GroupAdapter.java:106)
    at com.arewagirlcoder.welearn.GroupAdapter.onBindViewHolder(GroupAdapter.java:50)
    at com.arewagirlcoder.welearn.GroupAdapter.onBindViewHolder(GroupAdapter.java:25)
    at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6673)
    at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6714)
    at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5647)
    at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5913)
    at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5752)
    at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5748)
    at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2232)
    at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1559)
    at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1519)

```