diff --git a/packages/core/src/util/browser.ts b/packages/core/src/util/browser.ts index b8cc39e52..2fbda3ca1 100644 --- a/packages/core/src/util/browser.ts +++ b/packages/core/src/util/browser.ts @@ -1 +1,3 @@ -export const isIe = window.navigator.userAgent.match(/MSIE|Trident/) !== null; +import { get } from 'lodash-es'; + +export const isIe = get(window, 'navigator.userAgent', '').match(/MSIE|Trident/) !== null; diff --git a/packages/core/src/view/Anchor.tsx b/packages/core/src/view/Anchor.tsx index 4e873d983..53b5e0d2a 100644 --- a/packages/core/src/view/Anchor.tsx +++ b/packages/core/src/view/Anchor.tsx @@ -266,7 +266,7 @@ class Anchor extends Component { const nodeData = targetNode.getData(); graphModel.eventCenter.emit(EventType.CONNECTION_NOT_ALLOWED, { data: nodeData, - msg: targetMsg || sourceMsg, + msg: targetMsg || sourceMsg || '不允许添加连线', }); return null; }