summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-21 21:39:14 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-21 21:46:41 (GMT)
commitd2a21b5fc979b07794cd42ad551dd5f4f996fdc6 (patch)
treef21e7d6cfcf3b4ae9f0809ae89ba5efec40d441a
parente96118247793fdf4b40dc61d7ebd2c19a64939a3 (diff)
downloadswift-d2a21b5fc979b07794cd42ad551dd5f4f996fdc6.zip
swift-d2a21b5fc979b07794cd42ad551dd5f4f996fdc6.tar.bz2
Fix crash when Swiften isn't loaded dynamically via JNI.
Test-Information: This change re-enables pushing our integration tests to an android device or vm and running them successfully. These executables are statically build and linked against Swiften, so no Java environment will be available at runtime. Change-Id: I3a156cc38c062a47084c73d05a0b1383c963ec2a
-rw-r--r--3rdParty/Unbound/src/android/dns/dns_android.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/3rdParty/Unbound/src/android/dns/dns_android.cpp b/3rdParty/Unbound/src/android/dns/dns_android.cpp
index 4b1c368..d7cfa15 100644
--- a/3rdParty/Unbound/src/android/dns/dns_android.cpp
+++ b/3rdParty/Unbound/src/android/dns/dns_android.cpp
@@ -18,6 +18,9 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* /*aReserved*/) {
std::vector<std::string> get_servers() {
std::vector<std::string> servers;
+ if (javaVM == 0) {
+ return servers;
+ }
JNIEnv* env = 0;
int result = javaVM->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6);