Fix: use Optional chaining

This commit is contained in:
Nelson Chan
2021-07-22 16:13:58 +08:00
parent d0c63ebe3e
commit 7b8459c73a
2 changed files with 2 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ class Monitor extends BeanModel {
bean.ping = dayjs().valueOf() - startTime;
// Check certificate if https is used
if (this.getUrl().protocol === "https:") {
if (this.getUrl()?.protocol === "https:") {
await this.updateTlsInfo(checkCertificate(res));
}