Allow for null in CrashCategory return values
This commit is contained in:
parent
2629e940e7
commit
9b264ca6cc
4 changed files with 7 additions and 4 deletions
|
@ -68,5 +68,5 @@ interface CrashCategory {
|
||||||
channelSettings: ChannelSettings?,
|
channelSettings: ChannelSettings?,
|
||||||
throwable: Throwable?,
|
throwable: Throwable?,
|
||||||
fatal: Boolean,
|
fatal: Boolean,
|
||||||
): LinkedHashMap<String, Any>
|
): LinkedHashMap<String, Any?>
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -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<*, *>,
|
||||||
|
|
Loading…
Reference in a new issue