Access to a property for a non-object value

kiamlaluno - January 20, 2009 - 21:40
Project:Book access
Version:6.x-1.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Harry Slaughter
Status:closed
Description

_book_access_get_book_nid() has the following code:

<?php
function _book_access_get_book_nid($nid) {
 
$result = db_query("SELECT bid FROM {book} WHERE nid = %d", $nid);
  return
db_fetch_object($result)->bid;
}
?>

As db_fetch_object() can return FALSE, the return line tries to access a property for a value that is not an object.

#1

Harry Slaughter - January 21, 2009 - 05:01
Assigned to:Anonymous» Harry Slaughter

#2

Harry Slaughter - January 25, 2009 - 23:26
Status:active» fixed

This code has been removed entirely

#3

System Message - February 8, 2009 - 23:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.