Skip to content

Commit

Permalink
fix exception when using json output flag
Browse files Browse the repository at this point in the history
fixes the following exception, which breaks usage with ksdump:

   Exception in thread "main" scala.MatchError: ArrayBuffer(...)
  • Loading branch information
smx-smx committed Mar 16, 2024
1 parent 8aeb79a commit 6530e20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shared/src/main/scala/io/kaitai/struct/JSON.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package io.kaitai.struct

import io.kaitai.struct.translators.CommonLiterals

import scala.collection.mutable.ArrayBuffer

/** Common trait for all objects that can be serialized as JSON. */
trait Jsonable {
/** Serialize current state of the object into JSON string. */
Expand All @@ -24,6 +26,7 @@ object JSON extends CommonLiterals {
case v: String => stringToJson(v)
case v: Seq[_] => seqToJson(v)
case v: Map[String, _] => mapToJson(v)
case v: ArrayBuffer[_] => seqToJson(v.toSeq)
}
}

Expand Down

0 comments on commit 6530e20

Please sign in to comment.