Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1442b301 authored by Hasib Prince's avatar Hasib Prince
Browse files

fixed: nullpointerException from sentry

parent efc577d1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -299,7 +299,11 @@ class MainActivityViewModel @Inject constructor(
    }

    fun getLaunchIntentForPackageName(packageName: String): Intent? {
        return appLoungePackageManager.getLaunchIntent(packageName)
        return try {
            appLoungePackageManager.getLaunchIntent(packageName)
        } catch (e: Exception) {
            null
        }
    }

    fun launchPwa(application: Application) {
+3 −5
Original line number Diff line number Diff line
@@ -519,11 +519,9 @@ class ApplicationListRVAdapter(
                if (searchApp.is_pwa) {
                    mainActivityViewModel.launchPwa(searchApp)
                } else {
                    context.startActivity(
                        mainActivityViewModel.getLaunchIntentForPackageName(
                            searchApp.package_name
                        )
                    )
                    mainActivityViewModel.getLaunchIntentForPackageName(searchApp.package_name)?.let {
                        context.startActivity(it)
                    }
                }
            }
        }
+3 −2
Original line number Diff line number Diff line
@@ -204,8 +204,9 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), ApplicationInstall
            viewHolder?.let { parentViewHolder ->
                val childRV =
                    (parentViewHolder as HomeParentRVAdapter.ViewHolder).binding.childRV
                val adapter = childRV.adapter as HomeChildRVAdapter
                findDownloadingItemsToShowProgress(adapter, downloadProgress, childRV)
                (childRV.adapter as HomeChildRVAdapter?)?.let {
                    findDownloadingItemsToShowProgress(it, downloadProgress, childRV)
                }
            }
        }
    }
+3 −5
Original line number Diff line number Diff line
@@ -237,11 +237,9 @@ class HomeChildRVAdapter(
                if (homeApp.is_pwa) {
                    mainActivityViewModel.launchPwa(homeApp)
                } else {
                    context.startActivity(
                        mainActivityViewModel.getLaunchIntentForPackageName(
                            homeApp.package_name
                        )
                    )
                    mainActivityViewModel.getLaunchIntentForPackageName(homeApp.package_name)?.let {
                        context.startActivity(it)
                    }
                }
            }
        }