Skip to content

Commit

Permalink
fix(memory): possibly dereferencing null pointer
Browse files Browse the repository at this point in the history
Closes #441
  • Loading branch information
lotem committed Feb 9, 2021
1 parent bcf811c commit 1c2644d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rime/gear/memory.cc
Expand Up @@ -68,10 +68,10 @@ Memory::Memory(const Ticket& ticket) {

// user dictionary is named after language; dictionary name may have an
// optional suffix separated from the language component by dot.
language_.reset(new Language{
user_dict_ ? user_dict_->name() :
Language::get_language_component(dict_->name())
});
language_.reset(
user_dict_ ? new Language{user_dict_->name()} :
dict_ ? new Language{Language::get_language_component(dict_->name())} :
nullptr);

Context* ctx = ticket.engine->context();
commit_connection_ = ctx->commit_notifier().connect(
Expand Down

0 comments on commit 1c2644d

Please sign in to comment.