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

Console Error when loading user.image for users without an image #3

Open
aiudirog opened this issue Dec 31, 2016 · 0 comments
Open

Comments

@aiudirog
Copy link
Contributor

aiudirog commented Dec 31, 2016

Today I was setting up LightDM when I found your theme and really liked it. The only issue was that it crashed on most occasions when I went to go use it. From the logs, I was able to find this error:
file:///usr/share/lightdm-webkit/themes/archlinux/js/greeter.js:12:28: CONSOLE ERROR TypeError: null is not an object (evaluating 'user.image.length'). Upon further inspection, I found that user.image is null if there isn't an image, not an empty string. So, to fix this, I simply replaced var imageSrc = user.image.length > 0 ? user.image : tux; with var imageSrc = user.image ? user.image : tux; on line 12 of greeter.js. This still works even if user.image is an empty string as far as my tests in Chromium's debugger go.

aiudirog added a commit to aiudirog/lightdm-webkit-theme-archlinux that referenced this issue Dec 31, 2016
@aiudirog aiudirog mentioned this issue Dec 31, 2016
Dissonant-Tech added a commit that referenced this issue Jan 19, 2017
@FFY00 FFY00 mentioned this issue Oct 24, 2018
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

1 participant