Author: vyemialyanchyk
Date: 2010-02-09 09:40:04 -0500 (Tue, 09 Feb 2010)
New Revision: 20199
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5817 - fix update - additional check for null
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-02-09
14:28:00 UTC (rev 20198)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-02-09
14:40:04 UTC (rev 20199)
@@ -653,22 +653,26 @@
}
if (configXMLFile == null && classLoader != null) {
URL url = classLoader.findResource("hibernate.cfg.xml"); //$NON-NLS-1$
- URI uri = null;
- try {
- uri = url.toURI();
- configXMLFile = new File(uri);
- } catch (URISyntaxException e) {
- // ignore
+ if (url != null) {
+ URI uri = null;
+ try {
+ uri = url.toURI();
+ configXMLFile = new File(uri);
+ } catch (URISyntaxException e) {
+ // ignore
+ }
}
}
if (configXMLFile == null) {
URL url =
Environment.class.getClassLoader().getResource("hibernate.cfg.xml");
//$NON-NLS-1$
- URI uri = null;
- try {
- uri = url.toURI();
- configXMLFile = new File(uri);
- } catch (URISyntaxException e) {
- // ignore
+ if (url != null) {
+ URI uri = null;
+ try {
+ uri = url.toURI();
+ configXMLFile = new File(uri);
+ } catch (URISyntaxException e) {
+ // ignore
+ }
}
}
return configXMLFile;