File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
SimpleAPI/src/main/java/com/bencodez/simpleapi/file Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ private JsonObject navigateToNode(String path) {
5353 String [] parts = path .split ("\\ ." );
5454 JsonObject current = conf ;
5555
56- for (int i = 0 ; i < parts .length - 1 ; i ++) {
57- if (current .has (parts [i ]) && current .get (parts [i ]).isJsonObject ()) {
58- current = current .getAsJsonObject (parts [i ]);
56+ // Updated: Additional checks and informative logs
57+ for (String part : parts ) {
58+ if (current .has (part ) && current .get (part ).isJsonObject ()) {
59+ current = current .getAsJsonObject (part );
5960 } else {
60- return null ;
61+ //System.out.println("navigateToNode: Invalid path component: " + part);
62+ return null ; // Return null when a part is invalid or not an object
6163 }
6264 }
63-
6465 return current ;
6566 }
6667
You can’t perform that action at this time.
0 commit comments