Browse Source

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

rdb 4 years ago
parent
commit
867cf0765c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      panda/src/express/virtualFileSystem.cxx

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

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