fix-nullptr

This commit is contained in:
codeboss 2025-02-24 15:12:14 +08:00
parent ca04e572be
commit a29515f72e
2 changed files with 6 additions and 5 deletions

View File

@ -6,7 +6,7 @@
<LocalDebuggerCommandArguments>--path "D:\Projects\Cpp\WsNovelParser\x64\test_file" --dest E:\</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerCommandArguments>--path "D:\CustomNovels\科学+修仙+创造世界" --dest E:\</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>--path "D:\Projects\Cpp\WsNovelParser\x64\test_file" --dest E:\</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>$(SolutionDir)$(Platform)\$(Configuration)\</LocalDebuggerWorkingDirectory>
</PropertyGroup>

View File

@ -339,12 +339,13 @@ void MatchCursor::enterExprs() {
}
void lib_syntax::MatchCursor::logExprsError(std::shared_ptr<const lib_words::IPrimitiveWord> t, const QString& msg) {
if(!this->_total_errors.contains(t->position()))
this->_total_errors[t->position()] = QStringList();
auto pos_key = t?t->position():0;
if(!this->_total_errors.contains(pos_key))
this->_total_errors[pos_key] = QStringList();
auto exists = this->_total_errors[t->position()];
auto exists = this->_total_errors[pos_key];
exists.append(msg);
this->_total_errors[t->position()] = exists;
this->_total_errors[pos_key] = exists;
this->_exprs_errors.last()->addError(t, msg);