You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core-sdk-samples/higgs-shop-sample-app/app/src/main/kotlin/com/mparticle/example/higgsshopsampleapp/repositories/ProductsRepository.kt
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,11 @@ class ProductsRepository() {
22
22
23
23
fungetProducts(context:Context) : List<Product> {
24
24
val jsonFileString = getJsonDataFromAsset(context, "products.json")
25
-
Log.i(TAG, jsonFileString ?:"Could not find local products.json")
25
+
if (jsonFileString.isNullOrBlank()) {
26
+
Log.e(TAG, "Could not find local products.json")
27
+
}
26
28
val listProductType =object:TypeToken<Products>() {}.type
27
-
var products:Products=Gson().fromJson(jsonFileString, listProductType)
29
+
val products:Products=Gson().fromJson(jsonFileString, listProductType)
0 commit comments