提交 54dfbf8c 编写于 作者: J Johannes Rieken

fix #34520

上级 ed20bae4
......@@ -56,7 +56,7 @@ export function isEmptyMarkdownString(oneOrMany: IMarkdownString | IMarkdownStri
export function isMarkdownString(thing: any): thing is IMarkdownString {
if (thing instanceof MarkdownString) {
return true;
} else if (typeof thing === 'object') {
} else if (thing && typeof thing === 'object') {
return typeof (<IMarkdownString>thing).value === 'string'
&& (typeof (<IMarkdownString>thing).isTrusted === 'boolean' || (<IMarkdownString>thing).isTrusted === void 0);
}
......
......@@ -158,7 +158,7 @@ export namespace MarkdownString {
}
function isCodeblock(thing: any): thing is Codeblock {
return typeof thing === 'object'
return thing && typeof thing === 'object'
&& typeof (<Codeblock>thing).language === 'string'
&& typeof (<Codeblock>thing).value === 'string';
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册