We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6de9ee2 commit 41e12ecCopy full SHA for 41e12ec
libaegisub/common/mru.cpp
@@ -139,8 +139,15 @@ void MRUManager::Load(std::string_view key, const json::Array& array) {
139
140
try {
141
mru[idx].reserve(array.size());
142
- for (std::string const& str : array)
143
- mru[idx].push_back(str);
+ for (std::string const& str : array) {
+ try {
144
+ mru[idx].push_back(str);
145
+ } catch (const std::exception &e) {
146
+ // Discard values with invalid (non-UTF-8) encodings.
147
+ // The exceptions thrown by the std::filesystem::path constructur are implementation-defined
148
+ // so we have to do a catchall.
149
+ }
150
151
}
152
catch (json::Exception const&) {
153
// Out of date MRU file; just discard the data and skip it
0 commit comments