Skip to content

Commit fdacc22

Browse files
committed
fix Undefined index: line
1 parent 63be2a8 commit fdacc22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

laravel/app/Http/Repository/BusRepository.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,12 @@ public function cronTaskTable()
415415
'LineGuid' => $task['LineGuid'],
416416
'LineInfo' => $task['LineInfo'],
417417
];
418-
$data = $this->getLineData2('APTSLine.aspx', $post)['line'];
419-
$content = json_encode($data, JSON_UNESCAPED_UNICODE);
418+
$result = $this->getLineData2('APTSLine.aspx', $post);
419+
if (!isset($result['line'])) {
420+
continue;
421+
}
422+
423+
$content = json_encode($result['line'], JSON_UNESCAPED_UNICODE);
420424
if (!empty($content) && strlen($content) > 20) {
421425
// 入库操作 1 ----- 木渎
422426
$cron = ['line_info' => $post['LineInfo'], 'content' => $content];

0 commit comments

Comments
 (0)