Skip to content

[PORT] Tolerant null in LG context #1672

@tomlm

Description

@tomlm

Port this change from botbuilder-dotnet/master branch:
microsoft/botbuilder-dotnet#3329

close: #3326

Original issue:

# hello
- @{user.name}

Today if user.name is null, it will result an exception, we should change this to "null" (we can optimize the result later) so that user won't be interrupted by exceptions.

Expected result:

>if a == null or a.b == null, result would be string "null"
# template1
- @{a.b} 

> if a== null or a.b == null, result would be "result is 'null'"
# template2
- switch: @{a.b}
- CASE: @{'null'}
- result is 'null'

> if a template ref is return null, the result would be 
>{ "lgType":"MyStruct", "key1":"null"}
# template3
[MyStruct
    key1 = @{template4()}
]

> return null
# template4
- IF:@{false}
- hello 

Changed projects

  • Microsoft.Bot.Builder.LanguageGeneration
  • Microsoft.Bot.Builder.Dialogs.Adaptive.Templates.Tests
  • Microsoft.Bot.Builder.LanguageGeneration.Tests

Metadata

Metadata

Assignees

Labels

R8Release 8 - March 16th, 2020

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions