Skip to content

Commit 57da8db

Browse files
authored
Merge pull request #97 from mleiv/master
#96 - autoloader check class exists in array
2 parents 7e2f161 + 5a5fdf5 commit 57da8db

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ToolkitApi/autoload.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
'ToolkitApi\UInt16Param' => __DIR__ . DIRECTORY_SEPARATOR . 'UInt16Param.php',
4646
);
4747

48-
$file = $classmap[$class];
49-
if (file_exists($file)) {
50-
require_once $file;
48+
if (array_key_exists($class, $classmap)) {
49+
$file = $classmap[$class];
50+
if (file_exists($file)) {
51+
require_once $file;
52+
}
5153
}
5254

5355
return;

0 commit comments

Comments
 (0)