Skip to content

Comments

(fix) Avoid crash when there is no theme defined.#63

Merged
harvestcore merged 3 commits intodevelopfrom
optional-theme
Feb 12, 2026
Merged

(fix) Avoid crash when there is no theme defined.#63
harvestcore merged 3 commits intodevelopfrom
optional-theme

Conversation

@harvestcore
Copy link

@harvestcore harvestcore commented Feb 12, 2026

What the title says 🙂

The theme is optional and, unless specified, docxml does not include it by default.

Copy link

@jogawebb jogawebb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for catching the absence of theme1.xml, but in the long run we should probably look into whether or not we should just always create it.

try {
theme = await ThemeXml.fromArchive(archive);
} catch (_) {
// no-op

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a warning or something similar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could add a console.warn or something similar here, but it won't be captured.

@harvestcore harvestcore merged commit ad262c1 into develop Feb 12, 2026
2 checks passed
@harvestcore harvestcore deleted the optional-theme branch February 12, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants