Skip to content

Commit f32ead9

Browse files
committed
修复未发生sql查询时报错
1 parent 17a8035 commit f32ead9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Aspect/ResponseAspect.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint)
6868
if (!$this->config['enabled']) {
6969
return $proceedingJoinPoint->process();
7070
}
71-
72-
$eventSqlList = Context::get($sqlKey);
71+
$response = $proceedingJoinPoint->process();
72+
if (!($eventSqlList = Context::get($sqlKey))) {
73+
return $response;
74+
}
7375

7476
$explains = [];
7577
$channel = new Channel();
76-
$response = $proceedingJoinPoint->process();
7778
$oldBody = json_decode(
7879
$response->getBody()->getContents(),
7980
true,

0 commit comments

Comments
 (0)