Protects against Timeout in getJavaElement
Attempts to detect issues with NPE