Maurits van der Schee 3 years ago
parent
commit
adb1b87ebb
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      api.php
  2. 1
    1
      src/Tqdev/PhpCrudApi/Middleware/MultiTenancyMiddleware.php

+ 1
- 1
api.php View File

@@ -7954,7 +7954,7 @@ namespace Tqdev\PhpCrudApi\Middleware {
7954 7954
         private function getPairs($handler, string $operation, string $tableName): array
7955 7955
         {
7956 7956
             $result = array();
7957
-            $pairs = call_user_func($handler, $operation, $tableName);
7957
+            $pairs = call_user_func($handler, $operation, $tableName) ?: [];
7958 7958
             $table = $this->reflection->getTable($tableName);
7959 7959
             foreach ($pairs as $k => $v) {
7960 7960
                 if ($table->hasColumn($k)) {

+ 1
- 1
src/Tqdev/PhpCrudApi/Middleware/MultiTenancyMiddleware.php View File

@@ -38,7 +38,7 @@ class MultiTenancyMiddleware extends Middleware
38 38
     private function getPairs($handler, string $operation, string $tableName): array
39 39
     {
40 40
         $result = array();
41
-        $pairs = call_user_func($handler, $operation, $tableName);
41
+        $pairs = call_user_func($handler, $operation, $tableName) ?: [];
42 42
         $table = $this->reflection->getTable($tableName);
43 43
         foreach ($pairs as $k => $v) {
44 44
             if ($table->hasColumn($k)) {

Loading…
Cancel
Save