File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/src/main/java/com/duckduckgo/app/systemsearch Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1616
1717package com.duckduckgo.app.systemsearch
1818
19+ import android.content.pm.PackageManager.NameNotFoundException
1920import android.view.LayoutInflater
2021import android.view.View
2122import android.view.ViewGroup
@@ -43,8 +44,12 @@ class DeviceAppSuggestionsAdapter(
4344 holder.root.setOnClickListener {
4445 clickListener(app)
4546 }
46- val drawable = app.retrieveIcon(holder.icon.context.packageManager)
47- holder.icon.setImageDrawable(drawable)
47+ try {
48+ val drawable = app.retrieveIcon(holder.icon.context.packageManager)
49+ holder.icon.setImageDrawable(drawable)
50+ } catch (e: NameNotFoundException ) {
51+ holder.icon.setImageDrawable(null )
52+ }
4853 }
4954
5055 override fun getItemCount (): Int {
You can’t perform that action at this time.
0 commit comments