diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp index 64fcfc8963d39aca2b28d346993d842a496252c3..b6edcfc79948c320c7e552d6078e2d1388c8f50c 100644 --- a/base/src/parcel.cpp +++ b/base/src/parcel.cpp @@ -126,6 +126,10 @@ bool Parcel::EnsureWritableCapacity(size_t desireCapacity) return false; } if (desireCapacity <= GetWritableBytes()) { + if (data_ == nullptr) { + UTILS_LOGE("data_ is nullptr when capacity is available"); + return false; + } return true; }