When updating an item icon in Heimdall for an item without a password, the app returns a 500 Internal Server Error. The logs show the following trace:
Attempt to read property "password" on null at ItemController.php:315
Steps to reproduce:
- Create an item without a password.
- Update the item (for example, change the icon) without entering a password.
- Observe the error in logs.
Expected behavior:
Updating an item icon without a password should not crash. The stored password should be preserved if it exists, or left as null if no password was previously set.
Additional information / Suggested fix:
The error occurs because storedConfigObject can be null if the item’s description is empty. Adding a null check around the password property prevents the crash:
if ($storedConfigObject && property_exists($storedConfigObject, 'password')) {
$configObject->password = $storedConfigObject->password;
} else {
$configObject->password = null;
}
Thank you for maintaining Heimdall, it’s a great project!
When updating an item icon in Heimdall for an item without a password, the app returns a 500 Internal Server Error. The logs show the following trace:
Attempt to read property "password" on null at ItemController.php:315
Steps to reproduce:
Expected behavior:
Updating an item icon without a password should not crash. The stored password should be preserved if it exists, or left as null if no password was previously set.
Additional information / Suggested fix:
The error occurs because storedConfigObject can be null if the item’s description is empty. Adding a null check around the password property prevents the crash:
if ($storedConfigObject && property_exists($storedConfigObject, 'password')) {
$configObject->password = $storedConfigObject->password;
} else {
$configObject->password = null;
}
Thank you for maintaining Heimdall, it’s a great project!