Closed hchunhui closed 3 years ago
https://github.com/rime/librime/blob/7d9ad77fb5e8e6e330925de5e09c6ecfc2d2f4fd/src/rime/gear/memory.cc#L55 Shouldn't be a null pointer as it is assigned an instance of Dictionary in the constructor. But the Dictionary may not be loaded.
I think Memory::dict_
can be NULL, but I'm not sure if it will happen in reality.
The Create()
function may return nullptr
:
https://github.com/rime/librime/blob/7d9ad77fb5e8e6e330925de5e09c6ecfc2d2f4fd/src/rime/dict/dictionary.cc#L368
And there is a check before Load()
:
https://github.com/rime/librime/blob/7d9ad77fb5e8e6e330925de5e09c6ecfc2d2f4fd/src/rime/gear/memory.cc#L56
you are right. the case dict_
is null should be handled.
https://github.com/rime/librime/blob/7d9ad77fb5e8e6e330925de5e09c6ecfc2d2f4fd/src/rime/gear/memory.cc#L73