Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2094 | minor | always | 10-19-07 14:02 | 10-19-07 16:20 | |
|
|||||
Reporter: | koreth | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.3 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.4 | ||
|
|||||
Summary: | 0002094: Null pointer exception in Env.getConnection() | ||||
Description: |
Since I can't reopen a bug: The patch I provided in bug 2093 was actually for the section of code below the one that was updated in svn revision 3265. That revision doesn't solve the NPE I was seeing. Updated patch that is more consistent with the code style of rev 3265: --- a/modules/quercus/src/com/caucho/quercus/env/Env.java +++ b/modules/quercus/src/com/caucho/quercus/env/Env.java @@ -695,9 +695,9 @@ public class Env { Connection conn; - if (oldEntry != null && ! oldEntry.getConnection().isClosed()) - conn = oldEntry.getConnection(); - else { + if (oldEntry == null + || (conn = oldEntry.getConnection()) == null + || conn.isClosed()) { if (userName == null || userName.equals("")) conn = database.getConnection(); else Also, it seems to me that the "_connMap.put()" call should be inside the "else" (in the pre-patched version of the code) rather than unconditional like it is now; the current code is adding a map entry for a ConnectionEntry that has no connection assigned to it whenever the oldEntry connection is used. But it's possible that's as intended. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
There are no notes attached to this issue. |