Picasso doesn't tolerate empty String URL?

The javadoc for Picasso.load() explicitly states that it will throw an IllegalArgumentException when the URL is null or empty. So that's what you can expect.


This might be too late but i encountered this error today and after read the documentation of Picasso#load method it states that passing empty or blank string will cause the method to throw IllegalArgumentException and passing a null will not throw an exception but trigger RequestCreator#error which will load error image if one is provided otherwise the target will display nothing.

if you have no control over the image url (say its coming from server) you can try the following:

 mPicasso.load(photo.isEmpty() ? null : photo)
                .placeholder(placeholder)
                .error(error_placeholder)
                .into(target);

I hope it helps you:

if (item.getImagen().isEmpty()) { //url.isEmpty()
        Picasso.with(mContext)
                .load(R.drawable.placeholder)
                .placeholder(R.drawable.placeholder)
                .error(R.drawable.placeholder)
                .into(holder.imageView);

    }else{
        Picasso.with(mContext)
                .load(item.getImagen())
                .placeholder(R.drawable.placeholder)
                .error(R.drawable.placeholder)
                .into(holder.imageView); //this is your ImageView
    }