Skip to content

Commit 2d20fc7

Browse files
committed
Don't try to access error_code if application_data is null.
1 parent 91288c8 commit 2d20fc7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

auth/src/desktop/rpcs/auth_response.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AuthError AuthResponse::error_code() const {
2323
if (IsSuccessful()) {
2424
return kAuthErrorNone;
2525
}
26-
if (!application_data_->error) {
26+
if (!application_data_ || !application_data_->error) {
2727
return kAuthErrorFailure;
2828
}
2929

auth/src/desktop/rpcs/auth_response.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ class AuthResponse
4040
bool IsSuccessful() const;
4141

4242
std::string error_message() const {
43-
return application_data_->error ? application_data_->error->message
44-
: std::string();
43+
if (application_data_ && application_data_->error)
44+
return application_data_->error->message;
45+
else
46+
return std::string();
4547
}
4648
};
4749

0 commit comments

Comments
 (0)