File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
android/src/main/java/com/onesignal/rnonesignalandroid Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -310,25 +310,23 @@ public static List<Object> convertReadableArrayToList(ReadableArray readableArra
310310
311311 private static Object convertValue (ReadableType type , ReadableMap map , String key ) {
312312 switch (type ) {
313- case Null : return null ;
314313 case Boolean : return map .getBoolean (key );
315314 case Number : return map .getDouble (key );
316315 case String : return map .getString (key );
317316 case Map : return convertReadableMapToMap (map .getMap (key ));
318317 case Array : return convertReadableArrayToList (map .getArray (key ));
319- default : throw new IllegalArgumentException ( "Unknown type for key: " + key ) ;
318+ default : return null ;
320319 }
321320 }
322321
323322 private static Object convertValue (ReadableType type , ReadableArray array , int index ) {
324323 switch (type ) {
325- case Null : return null ;
326324 case Boolean : return array .getBoolean (index );
327325 case Number : return array .getDouble (index );
328326 case String : return array .getString (index );
329327 case Map : return convertReadableMapToMap (array .getMap (index ));
330328 case Array : return convertReadableArrayToList (array .getArray (index ));
331- default : throw new IllegalArgumentException ( "Unknown type for index: " + index ) ;
329+ default : return null ;
332330 }
333331 }
334332
Original file line number Diff line number Diff line change @@ -1019,7 +1019,7 @@ export namespace OneSignal {
10191019 * Returns true if the value is a JSON-serializable object.
10201020 */
10211021function isObjectSerializable ( value : unknown ) : boolean {
1022- if ( ! ( typeof value === 'object' && value !== null && ! Array . isArray ( value ) ) ) {
1022+ if ( typeof value !== 'object' || value === null || Array . isArray ( value ) ) {
10231023 return false ;
10241024 }
10251025 try {
You can’t perform that action at this time.
0 commit comments