Skip to content

Commit 3eb39b2

Browse files
committed
Fix NULL valued model variable bug
1 parent 14cd273 commit 3eb39b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Model.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ protected function _relationship($modelName, $relationship, $foreignKey=null, $l
11801180
} else {
11811181
// Original CodeIgniter 3 model loader
11821182
get_instance()->load->model($modelName);
1183-
$model = $this->$modelName;
1183+
$model = get_instance()->$modelName;
11841184
}
11851185

11861186
$libClass = __CLASS__;
@@ -1560,7 +1560,7 @@ public function __get($name)
15601560
} else {
15611561
// Original CodeIgniter 3 model loader
15621562
get_instance()->load->model($modelName);
1563-
$model = $this->$modelName;
1563+
$model = get_instance()->$modelName;
15641564
}
15651565

15661566
// Check return type

0 commit comments

Comments
 (0)