Skip to content

Sometimes Android crash on stop #36

@kayzenkayzen

Description

@kayzenkayzen

Sometimes crash when stop recording with this error:

Fatal Exception: java.lang.NumberFormatException
Invalid int: "null"
com.kevinresol.react_native_sound_recorder.RNSoundRecorderModule.stop


For some reason, we are receiving null as duration, so parseInt expect an integer but receive null then crashes

int duration = Integer.parseInt(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions