Skip to content

Commit aabded2

Browse files
Fixed a bug when processing discussions
1 parent d337a38 commit aabded2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

app/Data/NotificationData.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ public function __construct(array $data, int $index)
4545

4646
protected function issueId(array $data): int
4747
{
48-
$values = $this->parseUrl($data);
48+
if ($values = $this->parseUrl($data)) {
49+
return (int) end($values);
50+
}
4951

50-
return (int) end($values);
52+
return (int) $this->get($data, 'id');
5153
}
5254

53-
protected function parseUrl(array $data): array
55+
protected function parseUrl(array $data): ?array
5456
{
55-
return explode('/', $this->get($data, 'subject.url'));
57+
if ($url = $this->get($data, 'subject.url')) {
58+
return explode('/', $url);
59+
}
60+
61+
return null;
5662
}
5763
}

0 commit comments

Comments
 (0)