Mantis - Quercus
Viewing Issue Advanced Details
3221 minor always 01-06-09 12:42 01-06-09 15:56
koreth  
nam  
urgent  
closed 4.0.0  
unable to reproduce  
none    
none 4.0.0  
0003221: NPE when a Java method returns Java null
<?php
import test.TestClass;
function getFoo() {
  return TestClass::foo();
}


package test;
public class TestClass {
  public static String foo() { return null; }
}


This gives an NPE in compiled mode because the generated code is trying to call copyReturn() on the return value of the callMethod() call.

Workaround is to assign to a PHP variable and return that, or to make the Java code return NullValue.NULL.

Notes
(0003701)
nam   
01-06-09 15:23   
Issue does not exist on trunk.

php/3c3g
(0003703)
nam   
01-06-09 15:56   
php/3c3g