Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001231 [Quercus] minor always 07-05-06 17:00 07-15-06 10:38
Reporter koreth View Status public  
Assigned To nam
Priority normal Resolution fixed  
Status closed   Product Version 3.0.20
Summary 0001231: is_subclass_of throws NullPointerException
Description PHP:

<?php
if (! is_subclass_of(true, "foobar")) {
    print "boolean is not a foobar\n";
}
?>

This throws a NullPointerException in Quercus and works fine in standalone PHP. (Might happen with types other than boolean too, but that's what caused the exception in my actual code.)
Additional Information
Attached Files

- Relationships

- Notes
(0001397)
koreth
07-13-06 22:20

A simple patch that appears to fix the problem:

--- modules/quercus/src/com/caucho/quercus/lib/ClassesModule.java (revision 1255)
+++ modules/quercus/src/com/caucho/quercus/lib/ClassesModule.java (working copy)
@@ -140,7 +140,7 @@
     else
       cl = value.getQuercusClass();
 
- if (cl.getName().equalsIgnoreCase(name))
+ if (cl == null || cl.getName().equalsIgnoreCase(name))
       return false;
     else
       return cl.isA(name);
 
(0001400)
nam
07-14-06 17:02
edited on: 07-14-06 17:03

php/1j0c (issue resolved)

 

- Issue History
Date Modified Username Field Change
07-05-06 17:00 koreth New Issue
07-13-06 22:20 koreth Note Added: 0001397
07-14-06 17:02 nam Note Added: 0001400
07-14-06 17:03 nam Note Edited: 0001400
07-15-06 10:38 ferg Assigned To  => nam
07-15-06 10:38 ferg Status new => closed
07-15-06 10:38 ferg Resolution open => fixed
07-15-06 10:38 ferg Fixed in Version  => 3.0.20


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
33 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker