Skip to content

Commit 343fca4

Browse files
committed
3941: Fixed notified media url null bug
1 parent f7e58a1 commit 343fca4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#236](https://github.com/os2display/display-api-service/pull/236)
8+
- Fixed bug where no media url made Notified feed crash.
79
- [#231](https://github.com/os2display/display-api-service/pull/231)
810
- Adds new feed source: Eventdatabasen v2.
911
- [#233](https://github.com/os2display/display-api-service/pull/233)

src/Feed/NotifiedFeedType.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public function getData(Feed $feed): array
5656

5757
// Check that image is accessible, otherwise leave out the feed element.
5858
foreach ($feedItems as $feedItem) {
59-
$response = $this->client->request(Request::METHOD_HEAD, $feedItem['mediaUrl']);
59+
if (!empty($feedItem['mediaUrl'])) {
60+
$response = $this->client->request(Request::METHOD_HEAD, $feedItem['mediaUrl']);
61+
}
6062
$statusCode = $response->getStatusCode();
6163

6264
if (200 == $statusCode) {

0 commit comments

Comments
 (0)