Skip to content

Commit 451127d

Browse files
JBerendesShahen Hovhannisyan
authored andcommitted
complete when getting a null frame instance
1 parent 0f0950a commit 451127d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

android/src/main/java/com/shahenlibrary/Trimmer/Trimmer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public static void getPreviewImages(String path, Promise promise, ReactApplicati
9393

9494
for (int i = 0; i < duration; i += duration / 10) {
9595
Bitmap frame = retriever.getFrameAtTime(i * 1000);
96+
if(frame == null) {
97+
continue;
98+
}
9699
Bitmap currBmp = Bitmap.createScaledBitmap(frame, resizeWidth, resizeHeight, false);
97100

98101
Bitmap normalizedBmp = Bitmap.createBitmap(currBmp, 0, 0, resizeWidth, resizeHeight, mx, true);

0 commit comments

Comments
 (0)