UserOperationLog bug fix(User::Current() can be nullptr)
This commit is contained in:
@@ -65,7 +65,7 @@ void UserOperationLog::log(UserOperation operation, bool processing) {
|
|||||||
AppGlobalValues::setLastOperation(operation);
|
AppGlobalValues::setLastOperation(operation);
|
||||||
QString operationName = getOperationName(operation);
|
QString operationName = getOperationName(operation);
|
||||||
AppGlobalValues::setInProcessing(processing);
|
AppGlobalValues::setInProcessing(processing);
|
||||||
QString UserName = User::Current()->getUserCode().isEmpty()?"anonymous":User::Current()->getUserCode();
|
QString UserName = (!User::Current() || User::Current()->getUserCode().isEmpty())?"anonymous":User::Current()->getUserCode();
|
||||||
out << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<UserName<<"\t"<<operationName<<endl;
|
out << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<UserName<<"\t"<<operationName<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user