Skip to content

Commit a06cd6a

Browse files
committed
Fix 'undefined is not an object' when running in a headless browser
1 parent 018bf76 commit a06cd6a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/BootstrapTable.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1347,11 +1347,13 @@ class BootstrapTable extends Component {
13471347
for (const i in bodyHeader) {
13481348
if (bodyHeader.hasOwnProperty(i)) {
13491349
const child = bodyHeader[i];
1350-
if (child.style.width) {
1351-
header[i].style.width = child.style.width;
1352-
}
1353-
if (child.style.minWidth) {
1354-
header[i].style.minWidth = child.style.minWidth;
1350+
if (child.style) {
1351+
if (child.style.width) {
1352+
header[i].style.width = child.style.width;
1353+
}
1354+
if (child.style.minWidth) {
1355+
header[i].style.minWidth = child.style.minWidth;
1356+
}
13551357
}
13561358
}
13571359
}

0 commit comments

Comments
 (0)