Capture cast exception

This commit is contained in:
J-Jamet
2021-09-15 12:21:44 +02:00
parent b809180a1b
commit e9fc9cbc2a

View File

@@ -275,6 +275,7 @@ abstract class TemplateAbstractView<
templateAttribute: TemplateAttribute,
entryInfoValue: String,
showEmptyFields: Boolean) {
try {
var fieldView: TEntryFieldView? = findViewWithTag(fieldTag)
if (!showEmptyFields && entryInfoValue.isEmpty()) {
fieldView?.isFieldVisible = false
@@ -291,6 +292,9 @@ abstract class TemplateAbstractView<
}
fieldView?.value = entryInfoValue
fieldView?.applyFontVisibility(mFontInVisibility)
} catch(e: Exception) {
Log.e(TAG, "Unable to populate entry field view", e)
}
}
@Suppress("UNCHECKED_CAST")
@@ -299,7 +303,7 @@ abstract class TemplateAbstractView<
expires: Boolean,
expiryTime: DateInstant,
showEmptyFields: Boolean) {
try {
var fieldView: TDateTimeView? = findViewWithTag(fieldTag)
if (!showEmptyFields && !expires) {
fieldView?.isFieldVisible = false
@@ -315,6 +319,9 @@ abstract class TemplateAbstractView<
}
fieldView?.activation = expires
fieldView?.dateTime = expiryTime
} catch(e: Exception) {
Log.e(TAG, "Unable to populate date time view", e)
}
}
/**