aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2000-09-12 05:18:25 +0000
committerBruce Momjian <bruce@momjian.us>2000-09-12 05:18:25 +0000
commitaebfaf78614d477bc14fbbd25f3bd76512cc8f3e (patch)
tree8db263b71f5bd1425098d872d575084ffe98878f /src
parent7f171b599a50d471d4791c768b538978b4a2dc95 (diff)
downloadpostgresql-aebfaf78614d477bc14fbbd25f3bd76512cc8f3e.tar.gz
postgresql-aebfaf78614d477bc14fbbd25f3bd76512cc8f3e.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/jdbc/org/postgresql/util/PSQLException.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/util/PSQLException.java b/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
index 36290a5db15..1f206addce2 100644
--- a/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
+++ b/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
@@ -66,17 +66,21 @@ public class PSQLException extends SQLException
try {
bundle = ResourceBundle.getBundle("org.postgresql.errors");
} 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
// the supplied message instead.
- message = null;
- try {
- message = bundle.getString(id);
- } catch(MissingResourceException e) {
- message = id;
- }
+ message = null;
+ try {
+ message = bundle.getString(id);
+ } catch(MissingResourceException e) {
+ message = id;
+ }
+ }
// Expand any arguments
if(args!=null)