web code BUG fix

Signed-off-by: lanyill <lanyi3@huawei.com>
Change-Id: I45feeef02043af50cc5ba2475a6b33b323d03e35
This commit is contained in:
lanyill
2022-03-22 22:18:52 +08:00
parent 562206ba72
commit f69169d658
@@ -162,8 +162,8 @@ void JSWebController::LoadUrl(const JSCallbackInfo& args)
LOGE("JSWebController failed to parse url object");
return;
}
int np = webSrc.find_first_of("/");
url = (np < 0) ? webSrc : webSrc.erase(np, 1);
auto np = webSrc.find_first_of("/");
url = (np == std::string::npos) ? webSrc : webSrc.erase(np, 1);
} else if (!ConvertFromJSValue(valUrl, url)) {
LOGW("can't find url.");
return;