浏览代码

express: Fix crash on the Web when html file is in the web root

rdb 4 年之前
父节点
当前提交
867cf0765c
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      panda/src/express/virtualFileSystem.cxx

+ 5 - 0
panda/src/express/virtualFileSystem.cxx

@@ -884,6 +884,11 @@ get_global_ptr() {
         }
       }, cwd);
 
+      if (cwd[0] == 0) {
+        cwd[0] = '/';
+        cwd[1] = 0;
+      }
+
       _global_ptr->_cwd = cwd;
 
       // If we built with the Emscripten VFS enabled, mount it on top of the