AK: Unbreak FileSystemPath after String::split() changes

FileSystemPath(".") should not have a title(). This was caught by the
unit test for FileSystemPath, yay! :^)
This commit is contained in:
Andreas Kling 2020-01-22 22:34:16 +01:00
parent e64c335e5a
commit d66bbc21ce

View file

@ -86,7 +86,7 @@ void FileSystemPath::canonicalize()
m_basename = canonical_parts.last();
auto name_parts = m_basename.split('.');
m_title = name_parts[0];
m_title = name_parts.is_empty() ? String() : name_parts[0];
if (name_parts.size() > 1)
m_extension = name_parts[1];