Allow for null in CrashCategory return values

This commit is contained in:
JeremyStar™ 2024-12-19 02:46:09 +01:00
parent 2629e940e7
commit 9b264ca6cc
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
4 changed files with 7 additions and 4 deletions

View file

@ -68,5 +68,5 @@ interface CrashCategory {
channelSettings: ChannelSettings?, channelSettings: ChannelSettings?,
throwable: Throwable?, throwable: Throwable?,
fatal: Boolean, fatal: Boolean,
): LinkedHashMap<String, Any> ): LinkedHashMap<String, Any?>
} }

View file

@ -20,12 +20,13 @@
package de.staropensource.engine.base.implementable.logging package de.staropensource.engine.base.implementable.logging
import de.staropensource.engine.base.logging.Filterer
import de.staropensource.engine.base.type.logging.Call import de.staropensource.engine.base.type.logging.Call
/** /**
* Provides methods for filtering log calls. * Provides methods for filtering log calls.
* *
* @see de.staropensource.engine.logging.Filterer * @see Filterer
* @since v1-alpha10 * @since v1-alpha10
*/ */
interface Filter { interface Filter {

View file

@ -59,7 +59,7 @@ class InfoCrashCategory private constructor() : CrashCategory {
channelSettings: ChannelSettings?, channelSettings: ChannelSettings?,
throwable: Throwable?, throwable: Throwable?,
fatal: Boolean, fatal: Boolean,
): LinkedHashMap<String, Any> { ): LinkedHashMap<String, Any?> {
return linkedMapOf( return linkedMapOf(
Pair("Origin", linkedMapOf<String, Any>( Pair("Origin", linkedMapOf<String, Any>(
Pair("Class", call.origin), Pair("Class", call.origin),

View file

@ -110,7 +110,9 @@ class CrashHandler private constructor() {
builder.append("\n${" ".repeat(indent)}-> ${entry}") 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( builder.append(
compileCategory( compileCategory(
map[entry] as LinkedHashMap<*, *>, map[entry] as LinkedHashMap<*, *>,