Fix #562 javascript error in widget setup page

This commit is contained in:
Kijin Sung 2016-08-10 21:40:53 +09:00
parent 19592b1bd9
commit 95d34eb0bf

View file

@ -121,10 +121,10 @@ function doFillWidgetVars() {
if (node.name == 'widget_cache') {
var widget_cache = selected_node.getAttribute(node.name);
var widget_cache_unit = widget_cache.match(/[smhd]$/i);
var widget_cache_unit = widget_cache ? widget_cache.match(/[smhd]$/i) : 'm';
if (widget_cache_unit) {
jQuery("#widget_cache_unit").val(widget_cache_unit);
widget_cache = widget_cache.replace(/[smhd]$/i, "");
widget_cache = widget_cache ? widget_cache.replace(/[smhd]$/i, "") : 0;
}
jQuery("#widget_cache").val(widget_cache);
continue;