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

Internal server error in asset-admin if file is missing #65

Closed
kinglozzer opened this issue Aug 21, 2019 · 3 comments
Closed

Internal server error in asset-admin if file is missing #65

kinglozzer opened this issue Aug 21, 2019 · 3 comments

Comments

@kinglozzer
Copy link
Contributor

If the underlying file for an image is missing, clicking the file in the assets admin section results in an internal server error:

Call to a member function getWidth() on null

Which comes from here:

$previewImage = $this->image->FitMax($w * 2, $h * 2);
$state['data'] += [
'previewUrl' => $previewImage->URL,
'previewWidth' => $previewImage->getWidth(),
'previewHeight' => $previewImage->getHeight(),

I think we just need an if ($previewImage) check in there somewhere, I’m not sure what happens if you omit the previewUrl/previewWidth/previewHeight` schema items 😅

@jonom
Copy link
Owner

jonom commented Aug 21, 2019

Hmm that sounds just like this issue: #59 are you running 3.1.1?

@kinglozzer
Copy link
Contributor Author

Yeah I am on 3.1.1, #59 sounds similar but I think it’s a different cause

@jonom
Copy link
Owner

jonom commented Dec 17, 2019

Fixed by #74 thanks @kinglozzer and @ohararyan!

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

No branches or pull requests

2 participants