浏览代码

Make Left the default "side" for toggleDrawer (#2921)

Avoids a null pointer exception when not passing { side: "left" } to navigator.toggleDrawer() on Android
Jaime Agudo 6 年前
父节点
当前提交
3ab175cf3d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java

+ 2
- 2
android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java 查看文件

@@ -30,7 +30,7 @@ public class SideMenu extends DrawerLayout {
30 30
         }
31 31
 
32 32
         public static Side fromString(String side) {
33
-            return "left".equals(side.toLowerCase()) ? Left : Right;
33
+            return (side == null) || "left".equals(side.toLowerCase()) ? Left : Right;
34 34
         }
35 35
     }
36 36
 
@@ -181,4 +181,4 @@ public class SideMenu extends DrawerLayout {
181 181
             setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, params.side.gravity);
182 182
         }
183 183
     }
184
-}
184
+}