mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-25 09:44:02 +00:00
attempt to fix ttvfs crashes on osx
it's time to kick out the darn thing, but alas, not quite yet
This commit is contained in:
parent
6d70204847
commit
cd91ee51ef
2 changed files with 3 additions and 3 deletions
|
@ -172,7 +172,7 @@ void DirBase::forEachDir(DirEnumCallback f, void *user /* = NULL */, bool safe /
|
|||
|
||||
DirBase *DirBase::getDirByName(const char *dn, bool /* unused: lazyLoad = true */, bool useSubtrees /* = true */)
|
||||
{
|
||||
if(!dn[0] || (dn[0] == '.' && !dn[1]))
|
||||
if(!dn || !dn[0] || (dn[0] == '.' && !dn[1]))
|
||||
return this;
|
||||
|
||||
Dirs::iterator it = _subdirs.find(dn);
|
||||
|
@ -312,7 +312,7 @@ DirBase *Dir::getDirByName(const char *dn, bool lazyLoad /* = true */, bool useS
|
|||
return NULL;
|
||||
|
||||
// Fix for absolute paths: No dir should have '/' (or any other absolute dirs) as subdir.
|
||||
if(fullnameLen() && dn[0] == '/')
|
||||
if(fullnameLen() && (dn && dn[0] == '/'))
|
||||
return NULL;
|
||||
|
||||
// Lazy-load file if it's not in the tree yet
|
||||
|
|
|
@ -65,7 +65,7 @@ template <typename T> void SkipSelfPath(T *& s)
|
|||
|
||||
inline std::string joinPath(std::string base, const char *sub)
|
||||
{
|
||||
if(!*sub)
|
||||
if(!sub || !*sub)
|
||||
return base;
|
||||
if(*sub != '/' && base.length() && base[base.length()-1] != '/')
|
||||
base += '/';
|
||||
|
|
Loading…
Reference in a new issue