{"action":"created","issue":{"url":"https://api.github.com/repos/Pkmmte/CircularImageView/issues/52","repository_url":"https://api.github.com/repos/Pkmmte/CircularImageView","labels_url":"https://api.github.com/repos/Pkmmte/CircularImageView/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/Pkmmte/CircularImageView/issues/52/comments","events_url":"https://api.github.com/repos/Pkmmte/CircularImageView/issues/52/events","html_url":"https://github.com/Pkmmte/CircularImageView/issues/52","id":115669625,"number":52,"title":"NullPointerException with Picasso when there is no placeholder.","user":{"login":"ZxoR","id":12733033,"avatar_url":"https://avatars3.githubusercontent.com/u/12733033?v=4","gravatar_id":"","url":"https://api.github.com/users/ZxoR","html_url":"https://github.com/ZxoR","followers_url":"https://api.github.com/users/ZxoR/followers","following_url":"https://api.github.com/users/ZxoR/following{/other_user}","gists_url":"https://api.github.com/users/ZxoR/gists{/gist_id}","starred_url":"https://api.github.com/users/ZxoR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZxoR/subscriptions","organizations_url":"https://api.github.com/users/ZxoR/orgs","repos_url":"https://api.github.com/users/ZxoR/repos","events_url":"https://api.github.com/users/ZxoR/events{/privacy}","received_events_url":"https://api.github.com/users/ZxoR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-11-07T14:26:21Z","updated_at":"2018-04-10T09:09:31Z","closed_at":null,"author_association":"NONE","body":"The lines of code:\n\n```\n            final CircularImageView circularImageView = (CircularImageView) holder.mRootView.findViewById(R.id.circularImageView);\n\n                Picasso.with(holder.mRootView.getContext()).load(new File(trackingNumbers.get(position).getImageUrl())).error(R.drawable.no_image_place_holder).noFade().into(circularImageView);\n```\n\nThe exception:\n\n```\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:596)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.pkmmte.view.CircularImageView.refreshBitmapShader(CircularImageView.java:341)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.pkmmte.view.CircularImageView.invalidate(CircularImageView.java:262)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.widget.ImageView.setImageDrawable(ImageView.java:456)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.squareup.picasso.PicassoDrawable.setPlaceholder(PicassoDrawable.java:61)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.squareup.picasso.RequestCreator.into(RequestCreator.java:664)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.squareup.picasso.RequestCreator.into(RequestCreator.java:601)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at kael.trackninja.Adapters.TrackingRecyclerViewAdapter.onBindViewHolder(TrackingRecyclerViewAdapter.java:83)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at kael.trackninja.Adapters.TrackingRecyclerViewAdapter.onBindViewHolder(TrackingRecyclerViewAdapter.java:30)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:5212)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:5245)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4483)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4359)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1961)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1370)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1333)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:562)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2900)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1435)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:144)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:282)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.view.Choreographer.doCallbacks(Choreographer.java:580)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.view.Choreographer.doFrame(Choreographer.java:549)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5272)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)\n11-07 16:16:46.246 29353-29353/kael.trackninja E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)\n```\n\nIt happens only when using CircleImageView, when switching to regualr ImageView its not working.\n\nEDIT: I found that when you adding \"placeholder\" to picasso its working fine:\n\n```\n                Picasso.with(holder.mRootView.getContext()).load(new File(trackingNumbers.get(position).getImageUrl())).error(R.drawable.no_image_place_holder).noFade().placeholder(R.drawable.no_image_place_holder).into(circularImageView);\n```\n"},"comment":{"url":"https://api.github.com/repos/Pkmmte/CircularImageView/issues/comments/380029543","html_url":"https://github.com/Pkmmte/CircularImageView/issues/52#issuecomment-380029543","issue_url":"https://api.github.com/repos/Pkmmte/CircularImageView/issues/52","id":380029543,"user":{"login":"Snehal-Tembare","id":19224538,"avatar_url":"https://avatars3.githubusercontent.com/u/19224538?v=4","gravatar_id":"","url":"https://api.github.com/users/Snehal-Tembare","html_url":"https://github.com/Snehal-Tembare","followers_url":"https://api.github.com/users/Snehal-Tembare/followers","following_url":"https://api.github.com/users/Snehal-Tembare/following{/other_user}","gists_url":"https://api.github.com/users/Snehal-Tembare/gists{/gist_id}","starred_url":"https://api.github.com/users/Snehal-Tembare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snehal-Tembare/subscriptions","organizations_url":"https://api.github.com/users/Snehal-Tembare/orgs","repos_url":"https://api.github.com/users/Snehal-Tembare/repos","events_url":"https://api.github.com/users/Snehal-Tembare/events{/privacy}","received_events_url":"https://api.github.com/users/Snehal-Tembare/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T09:09:31Z","updated_at":"2018-04-10T09:09:31Z","author_association":"NONE","body":"Give placeholder explicitly like\r\nPicasso.with(this).load(imageUrl).placeholder(R.drawable.placeHolder).into(mImg);\r\nAbove line solved my problem... :)\r\n"}}
{"actor":{"display_login":"Snehal-Tembare"}}