Handling non-existing location in verific logs

This commit is contained in:
Miodrag Milanovic 2023-11-03 08:06:16 +01:00
parent 4eb18e1f07
commit f06d56d224
1 changed files with 3 additions and 1 deletions

View File

@ -115,7 +115,9 @@ void msg_func(msg_type_t msg_type, const char *message_id, linefile_type linefil
if (log_verific_callback) {
string full_message = stringf("%s%s\n", message_prefix.c_str(), message.c_str());
log_verific_callback(int(msg_type), message_id, LineFile::GetFileName(linefile), linefile->GetLeftLine(), linefile->GetLeftCol(), linefile->GetRightLine(), linefile->GetRightCol(), full_message.c_str());
log_verific_callback(int(msg_type), message_id, LineFile::GetFileName(linefile),
linefile ? linefile->GetLeftLine() : 0, linefile ? linefile->GetLeftCol() : 0,
linefile ? linefile->GetRightLine() : 0, linefile ? linefile->GetRightCol() : 0, full_message.c_str());
} else {
if (msg_type == VERIFIC_ERROR || msg_type == VERIFIC_WARNING || msg_type == VERIFIC_PROGRAM_ERROR)
log_warning_noprefix("%s%s\n", message_prefix.c_str(), message.c_str());