# Undefined method \`html\_safe' for nil:NilClass

**URL:** <https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769>\
**Category:** Uncategorized\
**Created:** [May 11, 2020, 2:48pm UTC](https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769 "2020-05-11T14:48:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aistech](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@aistech](https://forum.genieacs.com/u/aistech)\
**Post date:** [May 11, 2020, 2:48pm UTC](https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769/1 "2020-05-11T14:48:56Z")

</div>

I am attempting to load a new CPE into my GenieACS instance. The device connects and shows online in the device list, however, when I click “show”, I get the following message,

\<% if can?(:create, ‘files’) %\>

\<% software\_version = @device[‘InternetGatewayDevice’][‘DeviceInfo’][‘SoftwareVersion’][’\_value’] rescue @device[‘Device’][‘DeviceInfo’][‘SoftwareVersion’][’\_value’] rescue ‘’ %\>

\<%= link\_to 'Add Firmware', {controller: 'files', action: 'new', params: {oui: @device['\_deviceId']['\_OUI'].html\_safe, product\_class: @device['\_deviceId']['\_ProductClass'].html\_safe, version: software\_version.html\_safe }} %\>

\<% end %\>

\<% if can?(:delete, ‘devices’) %\>

Any thoughts?  
Thank you.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 12, 2020, 2:15am UTC](https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769/2 "2020-05-12T02:15:17Z")

</div>

Something is null (\_deviceId.\_ProductClass) which in theory should never be null given that the product class is part of any inform message.

Try deleting the device and wait for it to inform again.

---

<div class="post-metadata">

**Author:** ![aistech](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@aistech](https://forum.genieacs.com/u/aistech)\
**Post date:** [May 12, 2020, 2:47am UTC](https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769/3 "2020-05-12T02:47:28Z")

</div>

Ok, I have reached out to the CPE vendor and will pass that along. One thing they asked me for was a list of data models supported by GenieACS? Any thoughts?

Thank you.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 12, 2020, 3:03am UTC](https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769/4 "2020-05-12T03:03:05Z")

</div>

So the data model thats supported depends on the provision scripts you write. For ex, in our environment we initially did InternetGatewayDevice because thats what all of our devices used. We are adding a new device which does Device and so I’m currently adding support for that to our provision scripts.

---

<div class="post-metadata">

**Author:** ![aistech](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@aistech](https://forum.genieacs.com/u/aistech)\
**Post date:** [May 26, 2020, 11:58am UTC](https://forum.genieacs.com/t/undefined-method-html-safe-for-nil-nilclass/769/5 "2020-05-26T11:58:23Z")

</div>

ok, so that certainly explains my issue, thank you for the point in the right direction!!
