diff --git a/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts b/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts index 1b525867e4..6edd703d50 100644 --- a/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts +++ b/libraries/botbuilder-dialogs/src/memory/dialogStateManager.ts @@ -118,7 +118,8 @@ export class DialogStateManager { // Get memory scope to search over const scope = this.getMemoryScope(segments[0].toString()); if (scope == undefined) { - throw new Error(`DialogStateManager.getValue: a scope of '${segments[0]}' wasn't found.`); + console.warn(`DialogStateManager.getValue: a scope of '${segments[0]}' wasn't found for '${pathExpression}'.`); + return returnDefault(); } // Search over path diff --git a/libraries/botbuilder-dialogs/tests/memory/dialogStateManager.test.js b/libraries/botbuilder-dialogs/tests/memory/dialogStateManager.test.js index c6b5461d10..4027b21f0e 100644 --- a/libraries/botbuilder-dialogs/tests/memory/dialogStateManager.test.js +++ b/libraries/botbuilder-dialogs/tests/memory/dialogStateManager.test.js @@ -229,7 +229,7 @@ describe('Dialog State Manager', function () { }); it('raise an error if getValue() called with an invalid scope.', function () { - assert.throws(() => this.dc.state.getValue('foo.bar')); + assert.strictEqual(this.dc.state.getValue('foo.bar'), undefined); }); it('raise an error if setValue() called with missing path.', function () {