luci-base: cbi.js: properly handle falsy values in cbi_update_table()
authorJo-Philipp Wich <jo@mein.io>
Tue, 23 Nov 2021 18:11:34 +0000 (19:11 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 23 Nov 2021 18:13:00 +0000 (19:13 +0100)
Fixes: #5544
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e982c05671229b3d13622b38c9536812e8c5f05c)

modules/luci-base/htdocs/luci-static/resources/cbi.js

index 92c41515fb3d166a75600b9043ef4f325c1301c9..9dbbe6bdc1e476156917bfe0caadb28b81c8d913 100644 (file)
@@ -762,7 +762,7 @@ function cbi_update_table(table, data, placeholder) {
                                        var td = trow.appendChild(E('div', {
                                                'class': titles[i].className,
                                                'data-title': (text !== '') ? text : null
-                                       }, row[i] || ''));
+                                       }, (row[i] != null) ? row[i] : ''));
 
                                        td.classList.remove('th');
                                        td.classList.add('td');