LiangliangSui commented on code in PR #1686:
URL: https://github.com/apache/fury/pull/1686#discussion_r1644087062


##########
java/fury-core/src/main/java/org/apache/fury/Fury.java:
##########
@@ -310,12 +310,13 @@ private void write(MemoryBuffer buffer, Object obj) {
       buffer.writeInt32(-1); // preserve 4-byte for nativeObjects start 
offsets.
     }
     // reduce caller stack
-    if (!refResolver.writeRefOrNull(buffer, obj)) {
+    boolean isNull = refResolver.writeRefOrNull(buffer, obj);
+    if (!isNull) {
       ClassInfo classInfo = classResolver.getOrUpdateClassInfo(obj.getClass());
       classResolver.writeClass(buffer, classInfo);
       writeData(buffer, classInfo, obj);
     }
-    if (shareMeta) {
+    if (shareMeta && !isNull) {

Review Comment:
   Done.
   
   CI failure is not related to the current changes, fix it in 
https://github.com/apache/fury/pull/1691.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to