Fix #736: wrong format in Peertube accounts API result can prevent users to log in chat.
Can't reproduce the bug (https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/736), but this should fix the issue.
This commit is contained in:
		| @ -5,6 +5,7 @@ | |||||||
| ### Minor changes and fixes | ### Minor changes and fixes | ||||||
|  |  | ||||||
| * Translations updates. | * Translations updates. | ||||||
|  | * Fix #736: wrong format in Peertube accounts API result can prevent users to log in chat. | ||||||
|  |  | ||||||
| ## 14.0.0 | ## 14.0.0 | ||||||
|  |  | ||||||
|  | |||||||
| @ -37,7 +37,9 @@ local function read_avatar_url(ret) | |||||||
|           module:log("debug", "User avatar path (Peertube >= v6, width 48): %s", peertube_url .. avatar.path); |           module:log("debug", "User avatar path (Peertube >= v6, width 48): %s", peertube_url .. avatar.path); | ||||||
|           return peertube_url .. avatar.path; |           return peertube_url .. avatar.path; | ||||||
|         end |         end | ||||||
|         if (avatar.width < min_width) then; |         -- https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/736 | ||||||
|  |         -- seems that in some case, avatar.width is a table... So we check that it is a number. | ||||||
|  |         if (type(avatar.width) == 'number' and avatar.width < min_width) then; | ||||||
|           min_path = avatar.path; |           min_path = avatar.path; | ||||||
|           min_width = avatar.width; |           min_width = avatar.width; | ||||||
|         end |         end | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user