0027706: Foundation Classes - OSD_Path::DownTrek() crashes on empty argument
[occt.git] / src / OSD / OSD_Path.cxx
index c434dbe..5ceb366 100644 (file)
@@ -1085,7 +1085,7 @@ void OSD_Path :: DownTrek ( const TCollection_AsciiString& aName ) {
 
  Standard_Integer pos = myTrek.Length ();
 
- if (  aName.Value ( 1 ) != '|'    &&
+ if ( !aName.IsEmpty() && aName.Value ( 1 ) != '|'    &&
        pos                                 &&
        myTrek.Value ( pos ) != '|'
  )