panjiwa10028 / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

__get() fails poorly on invalid field #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Attempt to reference a field which doesn't exist in an Apache_Solr_Document
2. No checks that the key is present are made; a warning about an invalid index 
is raised

We develop in strict standards and throw ErrorExceptions whenever a warning is 
picked up, so this actually results in an uncaught exception for us.  

What is the expected output? What do you see instead?

I expect a null value.  I get a null + warning (which then throws an exception).

What version of the product are you using? On what operating system?

Current trunk.

Please provide any additional information below.

I've attached a patch if you're interested; the current behaviour may be 
desirable.  The patch simply checks if the array key is there and then returns 
null if it's not.

Original issue reported on code.google.com by liam.obo...@gmail.com on 6 Sep 2010 at 3:04

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed in r38

Original comment by donovan....@gmail.com on 7 Sep 2010 at 2:44