[GH-ISSUE #1274] Showing incomming mail fails if no contact modul is configurated #613

Closed
opened 2026-02-25 21:35:30 +03:00 by kerem · 0 comments
Owner

Originally created by @MatthiasDomroes on GitHub (Oct 7, 2024).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1274

Originally assigned to: @Bienvenumoringa on GitHub.

🐛 Bugreport

Version & Environment

2.4.0
Rev: [] /nOS: []
PHP 8.1 / Apache / Windows

Steps to reproduce

Using
CYPHT_MODULES="core,imap,smtp,account,idle_timer,profiles,imap_folders,pgp_mine"
within .env

Navigate to show an incomming Mail.

[07-Oct-2024 18:15:15 Africa/Abidjan] PHP Fatal error: Uncaught Error: Call to a member function get() on null in C:\IDE\cypht\modules\imap\output_modules.php:233
Stack trace:
#0 C:\IDE\cypht\lib\module.php(555): Hm_Output_filter_message_headers->output()
...

Caused by
$contact = ($this->get('contact_store'))->get(null, false, $contact_email);
$contact_exists = !empty($contact);

Better working code:
$contact_store = $this->get('contact_store');
$contact = !$contact_store ? null : $contact_store->get(null, false, $contact_email);
$contact_exists = !empty($contact);

Maybe other coding also fails - but not tested systematicly.

Originally created by @MatthiasDomroes on GitHub (Oct 7, 2024). Original GitHub issue: https://github.com/cypht-org/cypht/issues/1274 Originally assigned to: @Bienvenumoringa on GitHub. ## 🐛 Bugreport ### Version & Environment 2.4.0 Rev: [] /nOS: [] PHP 8.1 / Apache / Windows ### Steps to reproduce Using CYPHT_MODULES="core,imap,smtp,account,idle_timer,profiles,imap_folders,pgp_mine" within .env Navigate to show an incomming Mail. [07-Oct-2024 18:15:15 Africa/Abidjan] PHP Fatal error: Uncaught Error: Call to a member function get() on null in C:\IDE\cypht\modules\imap\output_modules.php:233 Stack trace: #0 C:\IDE\cypht\lib\module.php(555): Hm_Output_filter_message_headers->output() ... Caused by $contact = **($this->get('contact_store'))**->get(null, false, $contact_email); $contact_exists = !empty($contact); Better working code: $contact_store = $this->get('contact_store'); $contact = !$contact_store ? null : $contact_store->get(null, false, $contact_email); $contact_exists = !empty($contact); Maybe other coding also fails - but not tested systematicly.
kerem closed this issue 2026-02-25 21:35:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#613
No description provided.