Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaebfaf7

Browse files
committed
Attached is a patch that prevents a NullPointerException in the JDBC
driver if the translations files have not been properly installed. (Wecarefully avoided installing the translations file in a controlledenvironment here specifically to test for such a bug. :-)See attached description for more details.William--William Webber william@peopleweb.net.au
1 parent7f171b5 commitaebfaf7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎src/interfaces/jdbc/org/postgresql/util/PSQLException.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,21 @@ private void translate(String id,Object[] args)
6666
try {
6767
bundle =ResourceBundle.getBundle("org.postgresql.errors");
6868
}catch(MissingResourceExceptione) {
69+
// translation files have not been installed.
70+
message =id;
6971
}
7072
}
7173

74+
if (bundle !=null) {
7275
// Now look up a localized message. If one is not found, then use
7376
// the supplied message instead.
74-
message =null;
75-
try {
76-
message =bundle.getString(id);
77-
}catch(MissingResourceExceptione) {
78-
message =id;
79-
}
77+
message =null;
78+
try {
79+
message =bundle.getString(id);
80+
}catch(MissingResourceExceptione) {
81+
message =id;
82+
}
83+
}
8084

8185
// Expand any arguments
8286
if(args!=null)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp