BUAAserein commented on code in PR #12293:
URL: https://github.com/apache/iotdb/pull/12293#discussion_r1560476474


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/consensus/statemachine/dataregion/DataRegionStateMachine.java:
##########
@@ -287,15 +287,16 @@ public DataSet read(IConsensusRequest request) {
 
   @Override
   public File getSnapshotRoot() {
-    String snapshotDir =
-        
IoTDBDescriptor.getInstance().getConfig().getRatisDataRegionSnapshotDir()
-            + File.separator
-            + region.getDatabaseName()
-            + "-"
-            + region.getDataRegionId();
+    String snapshotDir = "null";
     try {
+      snapshotDir =
+          
IoTDBDescriptor.getInstance().getConfig().getRatisDataRegionSnapshotDir()
+              + File.separator
+              + region.getDatabaseName()
+              + "-"
+              + region.getDataRegionId();
       return new File(snapshotDir).getCanonicalFile();
-    } catch (IOException e) {
+    } catch (IOException | NullPointerException e) {

Review Comment:
   Because we found there may be a NPE in getDir when test IT, and this 
function could return null, so we catch here and return null.



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