Update LoadLibrary.java, pom.xml, and pom.xml

This commit is contained in:
Andrea Cavalli 2020-10-29 17:17:23 +01:00
parent 38ccacd18a
commit 2829f8c089
3 changed files with 5 additions and 4 deletions

View File

@ -25,6 +25,7 @@ import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import it.tdlight.jni.ObjectsUtils;
/** /**
* The class to load the libraries needed to run Tdlib * The class to load the libraries needed to run Tdlib
@ -144,8 +145,8 @@ public class LoadLibrary {
} }
InputStream libInputStream; InputStream libInputStream;
try { try {
libInputStream = (InputStream) classForResource.getDeclaredMethod("getLibraryAsStream").invoke(InputStream.class); libInputStream = ObjectsUtils.requireNonNull((InputStream) classForResource.getDeclaredMethod("getLibraryAsStream").invoke(InputStream.class));
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | NullPointerException e) {
throw new IOException("Native libraries for platform " + os + "-" + arch + " not found!", e); throw new IOException("Native libraries for platform " + os + "-" + arch + " not found!", e);
} }
if (Files.notExists(tempFile)) { if (Files.notExists(tempFile)) {

View File

@ -8,7 +8,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0-SNAPSHOT</revision> <revision>0-SNAPSHOT</revision>
<natives-version>3.0.125</natives-version> <natives-version>3.0.126</natives-version>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>

View File

@ -8,7 +8,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0-SNAPSHOT</revision> <revision>0-SNAPSHOT</revision>
<natives-version>3.0.125</natives-version> <natives-version>3.0.126</natives-version>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>