Skip to content

Commit 1c357f3

Browse files
committed
putil: fix asserts when model-cache-dir cannot be created
Fixes panda3d#790
1 parent f98c14c commit 1c357f3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

panda/src/express/virtualFileSystem.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,7 @@ make_directory_full(const Filename &filename) {
497497
// Now make the last one, and check the return value.
498498
PT(VirtualFile) result = do_get_file(filename, OF_make_directory);
499499
_lock.unlock();
500-
nassertr_always(result != nullptr, false);
501-
return result->is_directory();
500+
return (result != nullptr) ? result->is_directory() : false;
502501
}
503502

504503
/**

panda/src/putil/bamCache.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,16 @@ set_root(const Filename &root) {
133133
delete _index;
134134
_index = new BamCacheIndex;
135135
_index_stale_since = 0;
136+
137+
if (!vfs->is_directory(_root)) {
138+
util_cat.error()
139+
<< "Unable to make directory " << _root << ", caching disabled.\n";
140+
_active = false;
141+
return;
142+
}
143+
136144
read_index();
137145
check_cache_size();
138-
139-
nassertv(vfs->is_directory(_root));
140146
}
141147

142148
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy