Nightfirecat / RealmEye-API

An easy way to access your character data via RealmEye.
MIT License
13 stars 7 forks source link

Fix PHP Notice from trying to access property of non-object #42

Closed Nightfirecat closed 7 years ago

Nightfirecat commented 7 years ago

[Thu Jan 19 12:02:04.201139 2017] [:error] [pid 3826] [client \<redacted>:59143] PHP Notice: Trying to get property of non-object in \<redacted>/realmeye-api/index.php on line 209, referer: http://www.pfiffel.com/dps/

Need to break these DOMDocument calls into better logical pieces (table row/column/cell, HTML objects, etc.) so that this is a little more clear.

Nightfirecat commented 7 years ago

To be clear, this is the blob in question: https://github.com/Nightfirecat/RealmEye-API/blob/fd5e9fd25825cea7b8cd380c18610195f72c25de/index.php#L209

Line 209 is currently (with eab2e02) is line 211.

Nightfirecat commented 7 years ago

This seems to be caused when an item slot is empty. For example, 12 of these notices are raised when accessing this profile: https://www.realmeye.com/player/Purple