6643773 highlighted the fact that if the new plug-in's low level bootstrapping code fails, the current behavior is very poor: it crashes the web browser. Asserts are in place for debug builds, but these are not present in product builds, so we will typically dereference a NULL pointer in C++ code and crash.
Error checking should be added to the product builds so that the only user-visible side effect is perhaps a dialog box and a failure to render the applet. Specifically, explicit error checking needs to be added for at least the following situations:
- The JVM fails to initialize, and therefore JavaVM_GetJNIEnv() returns NULL early on in the new plug-in's code.
- Initialization of the JNI method IDs for the IExplorerPlugin, MozillaPlugin and AbstractPlugin Java classes fails for any reason.
- Instantiation of the Java-side IExplorerPlugin or MozillaPlugin objects fails.
Creation of for example our ActiveX control should simply return with an error, possibly raising a message box dialog. It should not crash.