Skip to content

Commit 197fe39

Browse files
committed
fix(template): avoid error on root tpl w/o slides
1 parent 5ffaa15 commit 197fe39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/classes/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class Template implements ITemplate {
100100
async countExistingSlides(): Promise<void> {
101101
const xml = await this.getSlideIdList();
102102
const sldIdLst = xml.getElementsByTagName('p:sldIdLst');
103-
if (sldIdLst) {
103+
if (sldIdLst.length > 0) {
104104
const existingSlides = sldIdLst[0].getElementsByTagName('p:sldId');
105105
this.existingSlides = existingSlides.length;
106106
}

0 commit comments

Comments
 (0)