Attached is a patch that prevents a NullPointerException in the JDBC
driver if the translations files have not been properly installed. (We carefully avoided installing the translations file in a controlled environment here specifically to test for such a bug. :-) See attached description for more details. William -- William Webber william@peopleweb.net.au
This commit is contained in:
parent
7f171b599a
commit
aebfaf7861
@ -66,17 +66,21 @@ public class PSQLException extends SQLException
|
|||||||
try {
|
try {
|
||||||
bundle = ResourceBundle.getBundle("org.postgresql.errors");
|
bundle = ResourceBundle.getBundle("org.postgresql.errors");
|
||||||
} catch(MissingResourceException e) {
|
} catch(MissingResourceException e) {
|
||||||
|
// translation files have not been installed.
|
||||||
|
message = id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bundle != null) {
|
||||||
// Now look up a localized message. If one is not found, then use
|
// Now look up a localized message. If one is not found, then use
|
||||||
// the supplied message instead.
|
// the supplied message instead.
|
||||||
message = null;
|
message = null;
|
||||||
try {
|
try {
|
||||||
message = bundle.getString(id);
|
message = bundle.getString(id);
|
||||||
} catch(MissingResourceException e) {
|
} catch(MissingResourceException e) {
|
||||||
message = id;
|
message = id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Expand any arguments
|
// Expand any arguments
|
||||||
if(args!=null)
|
if(args!=null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user