From 34423c7f58ada9315b4cc8ac64338a2576e82772 Mon Sep 17 00:00:00 2001 From: allen Date: Fri, 8 Dec 2023 20:45:48 +0800 Subject: [PATCH] fix: error: 'this' pointer is null [-Werror=nonnull] --- src/braft/storage.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/braft/storage.h b/src/braft/storage.h index 21b5e0d3..bdb59891 100644 --- a/src/braft/storage.h +++ b/src/braft/storage.h @@ -232,7 +232,9 @@ class Snapshot : public butil::Status { virtual int get_file_meta(const std::string& filename, ::google::protobuf::Message* file_meta) { (void)filename; - file_meta->Clear(); + if (file_meta != NULL) { + file_meta->Clear(); + } return 0; } };