env = android_java_env;
+ /* Return NULL if the class has not yet been obtained. */
+ if (!text_class.class)
+ return NULL;
+
/* Create an ExtractedText object containing this information. */
object = (*env)->NewObject (env, text_class.class,
text_class.constructor);
android_exception_check_1 (string);
ANDROID_DELETE_LOCAL_REF (string);
- /* extracted is now an associated ExtractedText object. Perform
- the update. */
- android_update_extracted_text (FRAME_ANDROID_WINDOW (f),
- extracted, token);
- ANDROID_DELETE_LOCAL_REF (extracted);
+ if (extracted)
+ {
+ /* extracted is now an associated ExtractedText object.
+ Perform the update. */
+ android_update_extracted_text (FRAME_ANDROID_WINDOW (f),
+ extracted, token);
+ ANDROID_DELETE_LOCAL_REF (extracted);
+ }
}
}