For #7522 Catch IllegalArgumentException when validating search string
parent
a58decd708
commit
a72620ae07
|
@ -171,8 +171,7 @@ class AddSearchEngineFragment : Fragment(), CompoundButton.OnCheckedChangeListen
|
|||
custom_search_engine_search_string_field.error = when {
|
||||
searchString.isEmpty() ->
|
||||
resources.getString(R.string.search_add_custom_engine_error_empty_search_string)
|
||||
!searchString.contains("%s")
|
||||
|| !searchString.contains("http") ->
|
||||
!searchString.contains("%s") ->
|
||||
resources.getString(R.string.search_add_custom_engine_error_missing_template)
|
||||
else -> null
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ object SearchStringValidator {
|
|||
client.fetch(request)
|
||||
} catch (e: IOException) {
|
||||
return Result.CannotReach
|
||||
} catch (e: IllegalArgumentException) {
|
||||
return Result.CannotReach
|
||||
}
|
||||
|
||||
// read the response stream to ensure the body is closed correctly. workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1603114
|
||||
|
|
Loading…
Reference in New Issue