diff --git a/frameworks/ans/src/reminder_store.cpp b/frameworks/ans/src/reminder_store.cpp index 7f8b4b1903f4096128d39f27781850b71f168949..394ef58d1a4cb6b295e3c15a4615d4068dc8db40 100644 --- a/frameworks/ans/src/reminder_store.cpp +++ b/frameworks/ans/src/reminder_store.cpp @@ -380,6 +380,10 @@ sptr ReminderStore::BuildReminder(const std::shared_ptr &bundleOption) const { + if (rdbStore_ == nullptr) { + ANSR_LOGE("Rdb store is not initialized."); + return false; + } NativeRdb::AbsRdbPredicates absRdbPredicates(REMINDER_DB_TABLE); absRdbPredicates.EqualTo(ReminderRequest::REMINDER_ID, std::to_string(reminderId)); std::shared_ptr queryResultSet = rdbStore_->Query(