Skip to content

Commit dbd3ccb

Browse files
committed
Check for empty path in finders
1 parent 10b2dd0 commit dbd3ccb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

demosys/loaders/base.py

+12
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,27 @@ def load(self) -> Any:
2525
raise NotImplementedError()
2626

2727
def find_data(self, path):
28+
if not path:
29+
return None
30+
2831
return self._find_last_of(Path(path), data.get_finders())
2932

3033
def find_program(self, path):
34+
if not path:
35+
return None
36+
3137
return self._find_last_of(Path(path), program.get_finders())
3238

3339
def find_texture(self, path):
40+
if not path:
41+
return None
42+
3443
return self._find_last_of(Path(path), textures.get_finders())
3544

3645
def find_scene(self, path):
46+
if not path:
47+
return None
48+
3749
return self._find_last_of(Path(path), scenes.get_finders())
3850

3951
def _find_last_of(self, path, finders):

0 commit comments

Comments
 (0)