Fixed production bug where visiting the edit page for a device with no SNMP discovery data would crash with "expected boolean on left-side of 'and', got: nil" error. The mikrotik_device?/1 function was using && operator which returns nil when device.snmp_device is nil, instead of returning false. The template conditional on line 455 requires a proper boolean value. Changed from: device.snmp_device && (...) To: not is_nil(device.snmp_device) and (...) This ensures the function always returns a boolean (true/false) instead of potentially returning nil. Added regression test to verify the page renders correctly when a device has no SNMP discovery data yet. Fixes: https://app.honeybadger.io/projects/136860/faults/127120431 |
||
|---|---|---|
| .. | ||
| channels | ||
| components | ||
| controllers | ||
| helpers | ||
| live | ||
| plugs | ||
| endpoint.ex | ||
| gettext.ex | ||
| gettext_helpers.ex | ||
| permissions.ex | ||
| router.ex | ||
| telemetry.ex | ||
| user_auth.ex | ||