Skip to content

Commit bca9c7d

Browse files
Cong Liurogerwang
authored andcommitted
Fixed ConvertToAbsolutePath to return a absolute path
When starting apps from a folder of parent, such as `nw ../app_root/`, icon file cannot be loaded correctly. The root cause is that `base::ReadFileToString` refused for path referencing to parent folder. However path of icon obtained by `nw::Package::ConvertToAbsolutePath` is still a relative path. The patch fixes `ConvertToAbsolutePath` to return a absolute path. fixed nwjs#5402
1 parent 1fa6e6f commit bca9c7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nw_package.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ FilePath Package::ConvertToAbsoutePath(const FilePath& path) {
235235
if (path.IsAbsolute())
236236
return path;
237237

238-
return this->path().Append(path);
238+
return MakeAbsoluteFilePath(this->path()).Append(path);
239239
}
240240

241241
GURL Package::GetStartupURL() {

0 commit comments

Comments
 (0)