Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes HTTP 500 "Attempt to read property "photo_id" on null" on album page when no photo is found for header #2396

Merged
merged 2 commits into from
Apr 20, 2024
Merged

Fixes HTTP 500 "Attempt to read property "photo_id" on null" on album page when no photo is found for header #2396

merged 2 commits into from
Apr 20, 2024

Conversation

nanawel
Copy link
Contributor

@nanawel nanawel commented Apr 20, 2024

It appears that \App\Livewire\Components\Pages\Gallery\Album::fetchHeaderUrl() does not properly handle the situation when no photo of the right ratio/type combination can be found in the content of the album.

And in this case, the result is pretty ugly 😕

image

The quick and dirty solution here is just to return null, at least until a better way to handle the case is found.

@ildyria
Copy link
Member

ildyria commented Apr 20, 2024

Thanks a lot of the investigation.

The quick and dirty solution here is just to return null, at least until a better way to handle the case is found.

This means that all the pictures in that folder have neither small, small2x or medium versions of size variant in landscape mode.

@ildyria ildyria merged commit bf49eab into LycheeOrg:master Apr 20, 2024
17 of 23 checks passed
@nanawel
Copy link
Contributor Author

nanawel commented Apr 20, 2024

This means that all the pictures in that folder have neither small, small2x or medium versions of size variant in landscape mode.

Exactly. Hence the "when no photo of the right ratio/type combination can be found" in my description but it wasn't that precise indeed.

@nanawel nanawel deleted the bugfix/http500-when-no-image-available-for-header branch April 20, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants