version 2.0 - call to a member function on non-object

Permalink Browser Info Environment
Ran into the error "Call to a member function getUserID() on a non-object in formidable/models/formidable.php on line 142"

Looked into the method and found the following code:
$u = User::getByUserID($value);
if (intval($u->getUserID()) != 0)


since User::getByUserID() returns either an object or false the test will cause that error if $value isn't found ...

changed the test to be:
if (is_object($u) && intval($u->getUserID()) != 0)


There are a couple of other places that need to be verified like that since the arguments aren't verified before calling the static method ...

Type: Discussion
Status: Resolved
dsdev
View Replies:
DeWebmakers replied on at Permalink Reply
DeWebmakers
Hi,

Thanx. Resolved in newer versions...

Best,

Corretje

concrete5 Environment Information

# concrete5 Version
5.6.3.3

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.