Skip to content

Commit

Permalink
Add a null check when mapping tracks (cjam#192)
Browse files Browse the repository at this point in the history
Fixes cjam#191
  • Loading branch information
pretorh authored and theshadowagent committed Jan 24, 2023
1 parent 56b20e6 commit 8e9a04c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions android/src/main/java/com/reactlibrary/Convert.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public static ReadableMap toMap(Artist artist) {
}

public static ReadableMap toMap(Track track) {
if (track == null) {
return null;
}
WritableMap map = Arguments.createMap();

map.putDouble("duration", (double) track.duration);
Expand Down

0 comments on commit 8e9a04c

Please sign in to comment.