Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt for JSON.parse returning null #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

opto
Copy link

@opto opto commented Oct 2, 2024

this doesn't always throw so we nedd to take care of it returning null

@opto opto requested a review from kewisch as a code owner October 2, 2024 07:18
@@ -144,7 +144,8 @@ class ExtCalendar extends cal.provider.BaseClass {
super.id = val;
if (this.id && this.uri) {
try {
this.capabilities = JSON.parse(super.getProperty("extensionCapabilities"));
this.capabilities = JSON.parse(super.getProperty("extensionCapabilities"))||
this.extension.manifest.calendar_provider.capabilities || {};
Copy link
Member

Choose a reason for hiding this comment

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

I see a little duplication between the try and the catch block. Could you pull the fallback out of the try catch to avoid the duplication?

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.

2 participants