Skip to content

Commit 8976cc3

Browse files
add null check and trim for navigation path in BaseNavigationManager
1 parent 6f68f4c commit 8976cc3

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

navigation/src/main/java/tools/dynamia/navigation/BaseNavigationManager.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,16 @@ public void navigateTo(String path) {
243243
*/
244244
@Override
245245
public void navigateTo(String path, Map<String, Serializable> params) {
246-
if (!path.contains("/")) {
247-
setActiveModule(container.getModuleById(path));
248-
} else {
249-
Page page = findPage(path);
250-
setCurrentPage(page, params);
246+
if(path!=null) {
247+
path = path.trim();
248+
if (!path.contains("/")) {
249+
setActiveModule(container.getModuleById(path));
250+
} else {
251+
Page page = findPage(path);
252+
setCurrentPage(page, params);
253+
}
254+
}else{
255+
logger.warn("path is null, cannot navigate");
251256
}
252257
}
253258

0 commit comments

Comments
 (0)