mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-02 23:40:43 +00:00
Fix for chid.value is undefined
This commit is contained in:
parent
672d25132f
commit
eb9102769c
@ -18,21 +18,21 @@ export class StylesToFontConverter implements Converter<string, Font> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ast.children.forEach(child => {
|
ast.children.forEach(child => {
|
||||||
if (child.property === 'font-size') {
|
if (child.property === 'font-size' && child.value && child.value.children) {
|
||||||
child.value.children.forEach(value => {
|
child.value.children.forEach(value => {
|
||||||
if (value.type === 'Dimension') {
|
if (value.type === 'Dimension') {
|
||||||
font.font_size = parseInt(value.value);
|
font.font_size = parseInt(value.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (child.property === 'font-family') {
|
if (child.property === 'font-family' && child.value && child.value.children) {
|
||||||
child.value.children.forEach(value => {
|
child.value.children.forEach(value => {
|
||||||
if (value.type === 'Identifier') {
|
if (value.type === 'Identifier') {
|
||||||
font.font_family = value.name;
|
font.font_family = value.name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (child.property === 'font-weight') {
|
if (child.property === 'font-weight' && child.value && child.value.children) {
|
||||||
child.value.children.forEach(value => {
|
child.value.children.forEach(value => {
|
||||||
if (value.type === 'Identifier') {
|
if (value.type === 'Identifier') {
|
||||||
font.font_weight = value.name;
|
font.font_weight = value.name;
|
||||||
|
@ -11,7 +11,7 @@ export class CssFixer {
|
|||||||
|
|
||||||
// fixes font-size when unit (pt|px) is not defined
|
// fixes font-size when unit (pt|px) is not defined
|
||||||
ast.children.forEach(child => {
|
ast.children.forEach(child => {
|
||||||
if (child.property === 'font-size') {
|
if (child.property === 'font-size' && child.value && child.value.children) {
|
||||||
child.value.children.forEach(value => {
|
child.value.children.forEach(value => {
|
||||||
if (value.type === 'Number') {
|
if (value.type === 'Number') {
|
||||||
const fontSize = value.value.toString();
|
const fontSize = value.value.toString();
|
||||||
|
@ -30,7 +30,7 @@ export class FontFixer {
|
|||||||
let isByIdentifier = true;
|
let isByIdentifier = true;
|
||||||
|
|
||||||
ast.children.forEach(child => {
|
ast.children.forEach(child => {
|
||||||
if (child.property === 'font-family') {
|
if (child.property === 'font-family' && child.value && child.value.children) {
|
||||||
child.value.children.forEach(value => {
|
child.value.children.forEach(value => {
|
||||||
if (value.type === 'Identifier') {
|
if (value.type === 'Identifier') {
|
||||||
fontFamilyPointer = value;
|
fontFamilyPointer = value;
|
||||||
@ -41,7 +41,7 @@ export class FontFixer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (child.property === 'font-size') {
|
if (child.property === 'font-size' && child.value && child.value.children) {
|
||||||
child.value.children.forEach(value => {
|
child.value.children.forEach(value => {
|
||||||
if (value.type === 'Dimension') {
|
if (value.type === 'Dimension') {
|
||||||
fontSizePointer = value;
|
fontSizePointer = value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user