Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Memory::dict_ be NULL ? #441

Closed
hchunhui opened this issue Jan 24, 2021 · 3 comments
Closed

Can Memory::dict_ be NULL ? #441

hchunhui opened this issue Jan 24, 2021 · 3 comments

Comments

@hchunhui
Copy link
Contributor

Language::get_language_component(dict_->name())

@lotem
Copy link
Member

lotem commented Feb 5, 2021

dict_.reset(dictionary->Create(ticket));

Shouldn't be a null pointer as it is assigned an instance of Dictionary in the constructor.
But the Dictionary may not be loaded.

@hchunhui
Copy link
Contributor Author

hchunhui commented Feb 9, 2021

I think Memory::dict_ can be NULL, but I'm not sure if it will happen in reality.

The Create() function may return nullptr:

Dictionary* DictionaryComponent::Create(const Ticket& ticket) {

And there is a check before Load():

@lotem
Copy link
Member

lotem commented Feb 9, 2021

you are right. the case dict_ is null should be handled.

@lotem lotem closed this as completed in 1c2644d Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants