Browse Source

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 years ago
parent
commit
3ab175cf3d

+ 2
- 2
android/app/src/main/java/com/reactnativenavigation/views/SideMenu.java View File

@@ -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
+}