production errors
This commit is contained in:
@@ -70,11 +70,21 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
if (checkHemoCubeKitData()) {
|
|
||||||
try {
|
try {
|
||||||
|
if (checkHemoCubeKitData()) {
|
||||||
DataHolder.selectedTest!!.kitSerial =
|
DataHolder.selectedTest!!.kitSerial =
|
||||||
sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
sharedPreference.getString(Constants.KIT_NUMBER, "").toString()
|
||||||
moveToNext()
|
moveToNext()
|
||||||
|
} else {
|
||||||
|
// Handle the case when checkHemoCubeKitData() returns false
|
||||||
|
with(sharedPreference.edit()) {
|
||||||
|
putString(Constants.KIT_NUMBER, "")
|
||||||
|
putInt(Constants.KIT_COUNT, 0)
|
||||||
|
putString(Constants.BUFFER_VALUE_1, "")
|
||||||
|
putString(Constants.BUFFER_VALUE_2, "")
|
||||||
|
apply()
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e: NullPointerException) {
|
} catch (e: NullPointerException) {
|
||||||
// Handle the NullPointerException here
|
// Handle the NullPointerException here
|
||||||
e.printStackTrace() // You can log the exception for debugging
|
e.printStackTrace() // You can log the exception for debugging
|
||||||
@@ -85,15 +95,6 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
// Optionally, show a user-friendly error message to the user
|
// Optionally, show a user-friendly error message to the user
|
||||||
// Toast.makeText(applicationContext, "An error occurred", Toast.LENGTH_SHORT).show()
|
// Toast.makeText(applicationContext, "An error occurred", Toast.LENGTH_SHORT).show()
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
with(sharedPreference.edit()) {
|
|
||||||
putString(Constants.KIT_NUMBER, "")
|
|
||||||
putInt(Constants.KIT_COUNT, 0)
|
|
||||||
putString(Constants.BUFFER_VALUE_1, "")
|
|
||||||
putString(Constants.BUFFER_VALUE_2, "")
|
|
||||||
apply()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
binding.nameEditText.setText("SMI/SC/")
|
binding.nameEditText.setText("SMI/SC/")
|
||||||
|
|||||||
Reference in New Issue
Block a user