diff --git a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets index 4053179009e46a18dd205b35616355987e780924..39f964fe8e7f4c43721edc280556e084d11eeddf 100644 --- a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets +++ b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/webview/in_app_webview/InAppWebView.ets @@ -884,7 +884,13 @@ export default class InAppWebView implements InAppWebViewInterface { async loadDataWithBaseURL(baseUrl: string, data: string, mimeType: string, encoding: string, historyUrl: string) { await this.waitControllerAttached(); - this.controller.loadData(data, mimeType, encoding, baseUrl, historyUrl) + if (baseUrl && historyUrl) { + this.controller.loadData(data, mimeType, encoding, baseUrl, historyUrl) + } else if (baseUrl) { + this.controller.loadData(data, mimeType, encoding, baseUrl) + } else { + this.controller.loadData(data, mimeType, encoding) + } } getController(): web_webview.WebviewController {