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

No picture is being generated #2

Closed
BolverBlitz opened this issue Jun 23, 2020 · 2 comments
Closed

No picture is being generated #2

BolverBlitz opened this issue Jun 23, 2020 · 2 comments

Comments

@BolverBlitz
Copy link

Fetching user GodOfOwls
Fetching Timeline page 1
Fetching Timeline page 2
Fetching Timeline page 3
Fetching Timeline page 4
Fetching Liked page 1
Fetching Liked page 2
Fetching Liked page 3
Fetching avatars 49
Done in 6.38s.

Other usernames work just fine, but here it does not work.

@chk1
Copy link

chk1 commented Jun 23, 2020

I had the same issue. When there are deleted user accounts, users[i].avatar is undefined and the script silently fails (like in your example).

const img = await loadImage(users[i].avatar);

Try surrounding that line with an if..else, maybe like so:

console.log(users[i].avatar);
if(users[i].avatar){
	const img = await loadImage(users[i].avatar);
	ctx.drawImage(
		img,
		centerX - radius,
		centerY - radius,
		radius * 2,
		radius * 2
	);
} else {
	console.log("Missing avatar image for");
	console.log(users[i]);
}

The resulting image will have a missing spot then.

BolverBlitz added a commit to BolverBlitz/twitter-interaction-circles-telegram that referenced this issue Jun 23, 2020
duiker101#2

Skipping useres without avatar.
@BolverBlitz
Copy link
Author

A big thank you, it works perfect now in my fork.

duiker101 added a commit that referenced this issue Jun 25, 2020
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