Fix a bug where void returns on upcalls crash the JVM

This commit is contained in:
Joshua Suskalo 2021-10-01 10:37:38 -05:00
parent 66eefc7a13
commit 22343b8512
2 changed files with 3 additions and 1 deletions

View file

@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This change
## [Unreleased]
### Fixed
- Void return types on upcalls crash the JVM
- Invalid implementation of serialize-into for primitive types
## [0.1.192] - 2021-09-30

View file

@ -315,7 +315,8 @@
(defmethod serialize* :default
[obj type _scope]
(if-let [prim (primitive-type type)]
((primitive-cast prim) obj)
(when-not (= ::void prim)
((primitive-cast prim) obj))
(throw (ex-info "Attempted to serialize a non-primitive type with primitive methods"
{:type type
:object obj}))))