File tree 2 files changed +14
-6
lines changed
src/Tqdev/PhpCrudUi/Column
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,13 @@ private function getDefinition(): array
25
25
if ($ data ) {
26
26
$ result = json_decode (gzuncompress ($ data ), true );
27
27
} else {
28
- $ result = $ this ->api ->getOpenApi ()?:[];
29
- $ data = gzcompress (json_encode ($ result ));
30
- $ this ->cache ->set ('Definition ' , $ data , $ this ->ttl );
28
+ $ result = $ this ->api ->getOpenApi ();
29
+ if ($ result ) {
30
+ $ data = gzcompress (json_encode ($ result ));
31
+ $ this ->cache ->set ('Definition ' , $ data , $ this ->ttl );
32
+ } else {
33
+ $ result = [];
34
+ }
31
35
}
32
36
return $ result ;
33
37
}
Original file line number Diff line number Diff line change @@ -10357,9 +10357,13 @@ private function getDefinition(): array
10357
10357
if ($ data ) {
10358
10358
$ result = json_decode (gzuncompress ($ data ), true );
10359
10359
} else {
10360
- $ result = $ this ->api ->getOpenApi ()?:[];
10361
- $ data = gzcompress (json_encode ($ result ));
10362
- $ this ->cache ->set ('Definition ' , $ data , $ this ->ttl );
10360
+ $ result = $ this ->api ->getOpenApi ();
10361
+ if ($ result ) {
10362
+ $ data = gzcompress (json_encode ($ result ));
10363
+ $ this ->cache ->set ('Definition ' , $ data , $ this ->ttl );
10364
+ } else {
10365
+ $ result = [];
10366
+ }
10363
10367
}
10364
10368
return $ result ;
10365
10369
}
You can’t perform that action at this time.
0 commit comments