Revision 1238

View differences:

trunk/libraries/libDriverManager/src/com/hardcode/driverManager/DriverManager.java
157 157
	 * @param name Objeto que devolvi? alguno de los drivers en su m?todo
158 158
	 * 		  getType
159 159
	 *
160
	 * @return El driver asociado o
160
	 * @return El driver asociado o null si no se encuentra el driver
161 161
	 *
162 162
	 * @throws DriverLoadException if this Class represents an abstract class,
163 163
	 * 		   an interface, an array class, a primitive type, or void; or if
......
166 166
	 */
167 167
	public Driver getDriver(String name) throws DriverLoadException {
168 168
		try {
169
			return (Driver) ((Class) nombreDriverClass.get(name)).newInstance();
169
			Class driverClass = (Class) nombreDriverClass.get(name);
170
			if (driverClass == null) throw new DriverLoadException("No se encontr? el driver.");
171
			return (Driver) driverClass.newInstance();
170 172
		} catch (InstantiationException e) {
171 173
			throw new DriverLoadException(e);
172 174
		} catch (IllegalAccessException e) {

Also available in: Unified diff