Assert some pointers that might be flaky.

Speculative fix; replaces nullpointer following with test failure.

Bug: b/307520538
Change-Id: I294d5747c852a8cde43a0acad973dca12712c69e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326000
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41077}
diff --git a/rtc_base/ssl_stream_adapter_unittest.cc b/rtc_base/ssl_stream_adapter_unittest.cc
index 0a99d9b..3c2ee8f 100644
--- a/rtc_base/ssl_stream_adapter_unittest.cc
+++ b/rtc_base/ssl_stream_adapter_unittest.cc
@@ -31,8 +31,11 @@
 #include "rtc_base/ssl_identity.h"
 #include "rtc_base/stream.h"
 #include "test/field_trial.h"
+#include "test/gmock.h"
+#include "test/gtest.h"
 
 using ::testing::Combine;
+using ::testing::NotNull;
 using ::testing::tuple;
 using ::testing::Values;
 using ::testing::WithParamInterface;
@@ -593,9 +596,12 @@
     size_t client_digest_len;
     bool rv;
 
+    ASSERT_THAT(server_identity(), NotNull());
     rv = server_identity()->certificate().ComputeDigest(
         rtc::DIGEST_SHA_1, server_digest, 20, &server_digest_len);
     ASSERT_TRUE(rv);
+
+    ASSERT_THAT(client_identity(), NotNull());
     rv = client_identity()->certificate().ComputeDigest(
         rtc::DIGEST_SHA_1, client_digest, 20, &client_digest_len);
     ASSERT_TRUE(rv);