# Javascript error when sending PM to email address

**URL:** https://meta.discourse.org/t/javascript-error-when-sending-pm-to-email-address/132065
**Category:** Bug
**Created:** [October 28, 2019, 1:46pm UTC](https://meta.discourse.org/t/javascript-error-when-sending-pm-to-email-address/132065 "2019-10-28T13:46:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [October 28, 2019, 1:46pm UTC](https://meta.discourse.org/t/javascript-error-when-sending-pm-to-email-address/132065/1 "2019-10-28T13:46:08Z")

</div>

Hey all! Trusting you are well and had a good weekend.

I am trying to send a PM to an email address, which usually works fine. Paste in email address, select from autocomplete, write rest of message, done. Now when I paste in the email address nothing happens and an error appears in the console - even in [safe mode](https://meta.discourse.org/t/53504?silent=true) with everything disabled. See screenshot and log below. I’m on latest-release +188.

 ![16%20AM](https://global.discourse-cdn.com/meta/original/3X/4/b/4ba796d1f9d91ad37ba9d350847e92c497939430.png)

### Message (2 copies reported)

```
Uncaught TypeError: Cannot read property 'length' of null Url: https://DISCOURSEURL/assets/application-11ddd9238d65444ab29fe3d9a5f36d4f99dabf8559c666441bff0bf449d85c6c.js Line: 1 Column: 326526 Window Location: https://DISCOURSEURL/u/tobiaseigen/messages

```

### Backtrace

```
TypeError: Cannot read property 'length' of null at HTMLInputElement.<anonymous> (https://DISCOURSEURL/assets/application-11ddd9238d65444ab29fe3d9a5f36d4f99dabf8559c666441bff0bf449d85c6c.js:1:326526) at HTMLInputElement.dispatch (https://DISCOURSEURL/assets/ember_jquery-3a6106596c1410fe768d3369b59e90f9eb4c3d8bf2eb6861dee02656c7551714.js:1:42577) at HTMLInputElement.v.handle (https://DISCOURSEURL/assets/ember_jquery-3a6106596c1410fe768d3369b59e90f9eb4c3d8bf2eb6861dee02656c7551714.js:1:40589)

```

### Env

```
  1/2  

hostname community-app
process_id 792
application_version 8ca5aad1e2b1612c2ef6824bd574eea9ef71d30d
HTTP_HOST DISCOURSEURL
REQUEST_URI /logs/report_js_error
REQUEST_METHOD POST
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36
HTTP_ACCEPT */*
HTTP_REFERER https://DISCOURSEURL/u/tobiaseigen/messages
HTTP_X_FORWARDED_FOR 73.239.176.161
HTTP_X_REAL_IP 73.239.176.161
time 6:29 am
params message Uncaught TypeError: Cannot read property 'length' of null
--- --- --- ---
--- ---
url https://DISCOURSEURL/assets/application-11ddd9238d65444ab29fe3d9a5f36d4f99dabf8559c666441bff0
line 1
column 326526
window_location https://DISCOURSEURL/u/tobiaseigen/messages
stacktrace TypeError: Cannot read property 'length' of null at HTMLInputElement.<anonymous> (https://communi

```

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [October 28, 2019, 5:52pm UTC](https://meta.discourse.org/t/javascript-error-when-sending-pm-to-email-address/132065/2 "2019-10-28T17:52:24Z")

</div>

Thanks for reporting this! I can reproduce the issue on Meta when attempting to send a PM to an email address.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [October 28, 2019, 6:33pm UTC](https://meta.discourse.org/t/javascript-error-when-sending-pm-to-email-address/132065/4 "2019-10-28T18:33:52Z")

</div>

Thanks @tobiaseigen, should be fixed by

[https://github.com/discourse/discourse/commit/071a82efe30e8f5fda274dfb1de4e0382ba132bf](https://github.com/discourse/discourse/commit/071a82efe30e8f5fda274dfb1de4e0382ba132bf)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 28, 2019, 9:22pm UTC](https://meta.discourse.org/t/javascript-error-when-sending-pm-to-email-address/132065/6 "2019-10-28T21:22:17Z")

</div>


