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


##########
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:
   can also spend time considering other solutions ...



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