zjcnb commented on a change in pull request #15176:
URL: https://github.com/apache/shardingsphere/pull/15176#discussion_r795001313



##########
File path: 
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineShardingAlgorithm.java
##########
@@ -84,6 +85,14 @@ public String doSharding(final Collection<String> 
availableTargetNames, final Pr
         return result;
     }
     
+    private String getTargetShardingNode(final Closure<?> closure, final 
String columnName) {
+        try {
+            return closure.call().toString();
+        } catch (final NullPointerException ex) {

Review comment:
       I can't find other way to avoid NPE. it cannot be judged before the 
call() method.




-- 
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]


Reply via email to