зеркало из https://github.com/nextcloud/desktop.git
ensure log context category is valid before reading it
category of logs accessed via log context can be null in such a case, strcmp will crash Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Родитель
3974040b0d
Коммит
35d4f91b42
|
@ -148,7 +148,7 @@ void Logger::doLog(QtMsgType type, const QMessageLogContext &ctx, const QString
|
|||
if (_doFileFlush)
|
||||
_logstream->flush();
|
||||
}
|
||||
if (_permanentDeleteLogStream && strcmp(ctx.category, lcPermanentLog().categoryName()) == 0) {
|
||||
if (_permanentDeleteLogStream && ctx.category && strcmp(ctx.category, lcPermanentLog().categoryName()) == 0) {
|
||||
(*_permanentDeleteLogStream) << msg << "\n";
|
||||
_permanentDeleteLogStream->flush();
|
||||
if (_permanentDeleteLogFile.size() > 10LL * 1024LL) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче