Skip to content

Commit d3b0040

Browse files
authored
Ensure src ends with .json file extension
This is a proposed fix for issue #37
1 parent 215c3e1 commit d3b0040

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/nativescript-lottie.android.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export class LottieView extends LottieViewBase {
8282

8383
private setSrc(src: string) {
8484
if (this.nativeView) {
85+
86+
src = /.json$/.test(src) ? src : `${src}.json`;
87+
8588
if (this.cacheStrategy) {
8689
this.nativeView.setAnimation(src, this.cacheStrategy);
8790
} else {

0 commit comments

Comments
 (0)