Skip to content

Commit

Permalink
fix: make image optional
Browse files Browse the repository at this point in the history
  • Loading branch information
therajanmaurya committed Oct 21, 2022
1 parent 0077156 commit 5f812bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class SweetUIErrorHandler(private val context: Context, private val view: View)
llErrorToLoad.visibility = View.GONE
llEmptyUI.visibility = View.GONE
llCustomUI.visibility = View.VISIBLE
ivCustomFeatureImage.setImageResource(featureImage!!)
featureImage?.let { ivCustomFeatureImage.setImageResource(it) } ?: run { ivCustomFeatureImage.visibility = View.GONE }
featureName?.let { tvCustomFeatureName.text = it } ?: run { tvCustomFeatureName.visibility = View.GONE }
subFeatureName?.let { tvCustomSubFeatureName.text = it } ?: run { tvCustomSubFeatureName.visibility = View.GONE }
}
Expand All @@ -172,7 +172,7 @@ class SweetUIErrorHandler(private val context: Context, private val view: View)
llErrorToLoad.visibility = View.GONE
llEmptyUI.visibility = View.GONE
llCustomUI.visibility = View.VISIBLE
ivCustomFeatureImage.setImageResource(featureImage!!)
featureImage?.let { ivCustomFeatureImage.setImageResource(it) } ?: run { ivCustomFeatureImage.visibility = View.GONE }
tvCustomFeatureName.text = featureName
tvCustomSubFeatureName.visibility = View.GONE
}
Expand Down

0 comments on commit 5f812bb

Please sign in to comment.