Janitor : Guard empty string

This commit is contained in:
Magne Sjaastad 2021-12-29 14:33:37 +01:00
parent db8209d23a
commit 442abfea05

View File

@ -28,6 +28,8 @@
//--------------------------------------------------------------------------------------------------
std::string RiaStdStringTools::trimString( const std::string& s )
{
if ( s.empty() ) return s;
auto sCopy = s.substr( 0, s.find_last_not_of( ' ' ) + 1 );
sCopy = sCopy.substr( sCopy.find_first_not_of( ' ' ) );