aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CaseConvert.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/CaseConvert.cxx')
-rw-r--r--src/CaseConvert.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx
index 03dbce4e9..fd1bee2c9 100644
--- a/src/CaseConvert.cxx
+++ b/src/CaseConvert.cxx
@@ -588,7 +588,13 @@ class CaseConverter : public ICaseConverter {
}
CharacterConversion(int character_, std::string_view conversion_) noexcept : character(character_) {
assert(conversion_.length() <= maxConversionLength);
- conversion_.copy(conversion.conversion, conversion_.length());
+ try {
+ // This can never fail as std::string_view::copy should only throw
+ // std::out_of_range if pos > size() and pos == 0 here
+ conversion_.copy(conversion.conversion, conversion_.length());
+ } catch (...) {
+ // Ignore any exception
+ }
}
bool operator<(const CharacterConversion &other) const noexcept {
return character < other.character;