Skip to content

Commit 826575f

Browse files
committed
phan
1 parent 220038c commit 826575f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

modules/media/php/mediafileprovisioner.class.inc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ class MediaFileProvisioner extends \LORIS\Data\Provisioners\DBRowProvisioner
3636
* Cache of instrument->getFullname returned value.
3737
* Initializing empty keys to prevent instanciation of empty testnames.
3838
*/
39-
private $_instrumentnames = [
40-
null => '',
41-
'' => ''
42-
];
39+
private $_instrumentnames = [];
4340

4441
/**
4542
* Create a MediaFileProvisioner, which gets files for the meida
@@ -92,7 +89,8 @@ class MediaFileProvisioner extends \LORIS\Data\Provisioners\DBRowProvisioner
9289
$testname = $row['testName'] ?? '';
9390
unset($row['testName']);
9491

95-
if (!isset($this->_instrumentnames[$testname])) {
92+
// make sure not to call the factory when $testname is null or ''
93+
if (!empty($testname) && !isset($this->_instrumentnames[$testname])) {
9694
$this->_instrumentnames[$testname] = \NDB_BVL_Instrument::factory(
9795
$this->lorisinstance,
9896
$testname,

0 commit comments

Comments
 (0)