Skip to content

Commit

Permalink
Fix: Prevent JavaScript error if message lacks From header (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Nov 18, 2023
1 parent 7da37c5 commit 1c8b96d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion server/ui-src/components/message/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ export default {
</span>
</td>
</tr>
<tr v-if="message.ReturnPath && message.ReturnPath != message.From.Address" class="small">
<tr v-if="message.ReturnPath && message.From && message.ReturnPath != message.From.Address"
class="small">
<th class="text-nowrap">Return-Path</th>
<td class="privacy text-body-secondary text-break">
&lt;<a :href="searchURI(message.ReturnPath)" class="text-body-secondary">
Expand Down
2 changes: 1 addition & 1 deletion server/ui-src/components/message/Release.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default {
<label class="col-sm-2 col-form-label text-body-secondary">From</label>
<div class="col-sm-10">
<input type="text" aria-label="From address" readonly class="form-control-plaintext"
:value="message.From.Address">
:value="message.From ? message.From.Address : ''">
</div>
</div>
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion server/ui-src/views/MessageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,6 @@ export default {

<AboutMailpit modals />
<AjaxLoader :loading="loading" />
<Release v-if="message" ref="ReleaseRef" :message="message" @delete="deleteMessage" />
<Release v-if="mailbox.uiConfig.MessageRelay && message" ref="ReleaseRef" :message="message" @delete="deleteMessage" />
<Screenshot v-if="message" ref="ScreenshotRef" :message="message" />
</template>

0 comments on commit 1c8b96d

Please sign in to comment.