Browse Source

Merge pull request #7560 from volzhs/issue-7555

Fix crash when creating new project
Rémi Verschelde 8 years ago
parent
commit
d13f2f9e25
1 changed files with 2 additions and 3 deletions
  1. 2 3
      core/ustring.cpp

+ 2 - 3
core/ustring.cpp

@@ -3898,10 +3898,9 @@ String String::get_extension() const {
 String String::plus_file(const String& p_file) const {
 	if (empty())
 		return p_file;
-	if (operator [](length()-1)=='/' || p_file.operator [](0)=='/')
+	if (operator [](length()-1)=='/' || (p_file.size()>0 && p_file.operator [](0)=='/'))
 		return *this+p_file;
-	else
-		return *this+"/"+p_file;
+	return *this+"/"+p_file;
 }
 
 String String::percent_encode() const {