From 9b264ca6cc68456ae25e0b884fdb3462d190e88e Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 19 Dec 2024 02:46:09 +0100 Subject: [PATCH] Allow for null in CrashCategory return values --- .../engine/base/implementable/logging/CrashCategory.kt | 2 +- .../engine/base/implementable/logging/Filter.kt | 3 ++- .../implementation/logging/crashcategory/InfoCrashCategory.kt | 2 +- .../de/staropensource/engine/base/logging/CrashHandler.kt | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/CrashCategory.kt b/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/CrashCategory.kt index 889efa8..125939a 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/CrashCategory.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/CrashCategory.kt @@ -68,5 +68,5 @@ interface CrashCategory { channelSettings: ChannelSettings?, throwable: Throwable?, fatal: Boolean, - ): LinkedHashMap + ): LinkedHashMap } diff --git a/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/Filter.kt b/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/Filter.kt index 4760efb..b722687 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/Filter.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/implementable/logging/Filter.kt @@ -20,12 +20,13 @@ package de.staropensource.engine.base.implementable.logging +import de.staropensource.engine.base.logging.Filterer import de.staropensource.engine.base.type.logging.Call /** * Provides methods for filtering log calls. * - * @see de.staropensource.engine.logging.Filterer + * @see Filterer * @since v1-alpha10 */ interface Filter { diff --git a/base/src/main/kotlin/de/staropensource/engine/base/implementation/logging/crashcategory/InfoCrashCategory.kt b/base/src/main/kotlin/de/staropensource/engine/base/implementation/logging/crashcategory/InfoCrashCategory.kt index 571f172..50de723 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/implementation/logging/crashcategory/InfoCrashCategory.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/implementation/logging/crashcategory/InfoCrashCategory.kt @@ -59,7 +59,7 @@ class InfoCrashCategory private constructor() : CrashCategory { channelSettings: ChannelSettings?, throwable: Throwable?, fatal: Boolean, - ): LinkedHashMap { + ): LinkedHashMap { return linkedMapOf( Pair("Origin", linkedMapOf( Pair("Class", call.origin), diff --git a/base/src/main/kotlin/de/staropensource/engine/base/logging/CrashHandler.kt b/base/src/main/kotlin/de/staropensource/engine/base/logging/CrashHandler.kt index fe8f506..1569858 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/logging/CrashHandler.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/logging/CrashHandler.kt @@ -110,7 +110,9 @@ class CrashHandler private constructor() { builder.append("\n${" ".repeat(indent)}-> ${entry}") - if (map[entry] is LinkedHashMap<*, *>) // Value is a map + if (map[entry] == null) // Value is null + true + else if (map[entry] is LinkedHashMap<*, *>) // Value is a map builder.append( compileCategory( map[entry] as LinkedHashMap<*, *>,