diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/DeserializationInput.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/DeserializationInput.kt index d1ed63327f..57371c7c9d 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/DeserializationInput.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/DeserializationInput.kt @@ -137,7 +137,7 @@ class DeserializationInput(internal val serializerFactory: SerializerFactory) { // Store the reference in case we need it later on. // Skip for primitive types as they are too small and overhead of referencing them will be much higher than their content - if (type.asClass()?.isPrimitive != true) objectHistory.add(objectRead) + if (suitableForObjectReference(objectRead.javaClass)) objectHistory.add(objectRead) objectRead }