mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fix possible uncaught exception
This commit is contained in:
parent
dd8a59fa86
commit
26bddbac44
@ -10,7 +10,14 @@ namespace vstd
|
||||
{
|
||||
std::tm tm = *std::localtime(&dt);
|
||||
std::stringstream s;
|
||||
s.imbue(std::locale(""));
|
||||
try
|
||||
{
|
||||
s.imbue(std::locale(""));
|
||||
}
|
||||
catch(const std::runtime_error & e)
|
||||
{
|
||||
// locale not be available - keep default / global
|
||||
}
|
||||
s << std::put_time(&tm, "%x %X");
|
||||
return s.str();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user