jni: avoid segfault in get
see
@@ -305,15 +305,12 @@ int elektraJniOpen (Plugin * handle, Key * errorKey)
int elektraJniClose (Plugin * handle, Key * errorKey)
{
Data * data = elektraPluginGetData (handle);
- if (!data)
- {
- return 0;
- }
- if (data->module == 1)
+ if (!data || data->module == 1)
{
return 0;
}
+
int ret = call1Arg (data, errorKey, "close");
(*data->jvm)->DestroyJavaVM (data->jvm);
@@ -341,10 +338,12 @@ int elektraJniGet (Plugin * handle, KeySet * returned, Key * parentKey)
}
Data * data = elektraPluginGetData (handle);
- if (data->module == 1)
+
+ if (!data || data->module == 1)
{
return 0;
}
+
return call2Arg (data, returned, parentKey, "get");
}
