Tourenathan-G5organisation/SiliCompressor

Attempt to invoke virtual method 'java.lang.String java.io.File.getPath()' on a null object reference

Opened this issue · 0 comments

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'java.lang.String java.io.File.getPath()' on a null object reference

public String compressVideo(String videoFilePath, String destinationDir, int outWidth, int outHeight, int bitrate) throws URISyntaxException {
boolean isconverted = MediaController.getInstance().convertVideo(videoFilePath, new File(destinationDir), outWidth, outHeight, bitrate);
if (isconverted) {
Log.v(LOG_TAG, "Video Conversion Complete");
} else {
Log.v(LOG_TAG, "Video conversion in progress");
}

    return MediaController.cachedFile.getPath();

}

occurring mainly on Vivo mobile phones operating on Android 9