@@ -42,6 +42,7 @@ QWebEngineCertificateError::~QWebEngineCertificateError() = default;
42
42
QSslError::SslError values are not used directly, because the Qt error
43
43
categories cannot be mapped to the Chromium error categories.
44
44
45
+ \value Ok There was no actual certificate error.
45
46
\value SslPinnedKeyNotInCertificateChain The certificate did not match the built-in public keys
46
47
pinned for the host name.
47
48
\value CertificateCommonNameInvalid The certificate's common name did not match the host name.
@@ -74,7 +75,9 @@ QWebEngineCertificateError::~QWebEngineCertificateError() = default;
74
75
*/
75
76
bool QWebEngineCertificateError::isOverridable () const
76
77
{
77
- return d->overridable ();
78
+ if (Q_LIKELY (d))
79
+ return d->overridable ();
80
+ return false ;
78
81
}
79
82
80
83
/* !
@@ -84,7 +87,9 @@ bool QWebEngineCertificateError::isOverridable() const
84
87
*/
85
88
QUrl QWebEngineCertificateError::url () const
86
89
{
87
- return d->url ();
90
+ if (Q_LIKELY (d))
91
+ return d->url ();
92
+ return QUrl ();
88
93
}
89
94
90
95
/* !
@@ -97,7 +102,9 @@ QUrl QWebEngineCertificateError::url() const
97
102
*/
98
103
bool QWebEngineCertificateError::isMainFrame () const
99
104
{
100
- return d->isMainFrame ();
105
+ if (Q_LIKELY (d))
106
+ return d->isMainFrame ();
107
+ return false ;
101
108
}
102
109
103
110
/* !
@@ -107,7 +114,9 @@ bool QWebEngineCertificateError::isMainFrame() const
107
114
*/
108
115
QWebEngineCertificateError::Type QWebEngineCertificateError::type () const
109
116
{
110
- return d->error ();
117
+ if (Q_LIKELY (d))
118
+ return d->error ();
119
+ return Ok;
111
120
}
112
121
113
122
/* !
@@ -117,7 +126,9 @@ QWebEngineCertificateError::Type QWebEngineCertificateError::type() const
117
126
*/
118
127
QString QWebEngineCertificateError::description () const
119
128
{
120
- return d->errorString ();
129
+ if (Q_LIKELY (d))
130
+ return d->errorString ();
131
+ return QString ();
121
132
}
122
133
123
134
/* !
@@ -135,7 +146,8 @@ QString QWebEngineCertificateError::description() const
135
146
*/
136
147
void QWebEngineCertificateError::defer ()
137
148
{
138
- d->defer ();
149
+ if (Q_LIKELY (d))
150
+ d->defer ();
139
151
}
140
152
141
153
/* !
@@ -145,7 +157,8 @@ void QWebEngineCertificateError::defer()
145
157
*/
146
158
void QWebEngineCertificateError::acceptCertificate ()
147
159
{
148
- d->ignoreCertificateError ();
160
+ if (Q_LIKELY (d))
161
+ d->ignoreCertificateError ();
149
162
}
150
163
151
164
/* !
@@ -155,7 +168,8 @@ void QWebEngineCertificateError::acceptCertificate()
155
168
*/
156
169
void QWebEngineCertificateError::rejectCertificate ()
157
170
{
158
- d->rejectCertificate ();
171
+ if (Q_LIKELY (d))
172
+ d->rejectCertificate ();
159
173
}
160
174
161
175
/* !
@@ -167,7 +181,9 @@ void QWebEngineCertificateError::rejectCertificate()
167
181
*/
168
182
QList<QSslCertificate> QWebEngineCertificateError::certificateChain () const
169
183
{
170
- return d->certificateChain ();
184
+ if (Q_LIKELY (d))
185
+ return d->certificateChain ();
186
+ return QList<QSslCertificate>();
171
187
}
172
188
173
189
QT_END_NAMESPACE
0 commit comments