-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedIssue has been reviewed and confirmed to be present or accepted to be implementedtopic/uiChange the appearance of the Gitea UIChange the appearance of the Gitea UItype/bug
Milestone
Description
caught by #18971 (Show JS errors) , reported by a user.
caused by imagediff.js
function getDefaultSvgBoundsIfUndefined(svgXml, src) {
const DefaultSize = 300;
const MaxSize = 99999;
const svg = svgXml.rootElement; // BUG, here svg might be null, then the following `svg.width` triggers JS error
const width = svg.width.baseVal;
const height = svg.height.baseVal;
if (width.unitType === SVGLength.SVG_LENGTHTYPE_PERCENTAGE || height.unitType === SVGLength.SVG_LENGTHTYPE_PERCENTAGE) {
Compiled JS, the index.js:37:1821
is at c=o.width
o=e.rootElement,c=o.width.baseVal,y=o.height.baseVal;if(c.unitType===SVGLength.SVG_LENGTHTYPE_PERCENTAG
Metadata
Metadata
Assignees
Labels
issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedIssue has been reviewed and confirmed to be present or accepted to be implementedtopic/uiChange the appearance of the Gitea UIChange the appearance of the Gitea UItype/bug
Type
Projects
Relationships
Development
Select code repository
Activity
KN4CK3R commentedon Apr 17, 2022
Do you have an example svg?
wxiaoguang commentedon Apr 17, 2022
No, I have asked but the reporter can not provide more information.
wxiaoguang commentedon Apr 17, 2022
I managed to reproduce it. See https://try.gitea.io/wxiaoguang/test/pulls/6/files
wxiaoguang commentedon Apr 25, 2022
I proposed a fix #19494