From c426f548e8aa55e399aa7d7c6f992bd148faac42 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 20 Mar 2024 11:46:21 +1100 Subject: [PATCH] misc --- src/platform/common/utils.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/platform/common/utils.ts b/src/platform/common/utils.ts index 78c35c67093..d12556a1715 100644 --- a/src/platform/common/utils.ts +++ b/src/platform/common/utils.ts @@ -476,9 +476,14 @@ export function useCustomMetadata() { if (ext && typeof ext.exports.dropCustomMetadata === 'boolean') { return ext.exports.dropCustomMetadata ? false : true; } - // Means ipynb extension has not yet been activated. - // Does not matter, we can just check the setting. - return !workspace.getConfiguration('jupyter', undefined).get('experimental.dropCustomMetadata', false); + try { + // Means ipynb extension has not yet been activated. + // Does not matter, we can just check the setting. + return !workspace.getConfiguration('jupyter', undefined).get('experimental.dropCustomMetadata', false); + } catch { + // This happens in unit tests, in this case just return `true`. + return true; + } } export async function activateIPynbExtension() {