From d66bbc21ce2b7369d70109c0ce2ce41c01241079 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 22 Jan 2020 22:34:16 +0100 Subject: [PATCH] AK: Unbreak FileSystemPath after String::split() changes FileSystemPath(".") should not have a title(). This was caught by the unit test for FileSystemPath, yay! :^) --- AK/FileSystemPath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/FileSystemPath.cpp b/AK/FileSystemPath.cpp index d060b98a16..1bb4f5b961 100644 --- a/AK/FileSystemPath.cpp +++ b/AK/FileSystemPath.cpp @@ -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];