[OpenWrt-Devel] [PATCH 1/4] luci2: fix Null pointer exception

Álvaro Fernández Rojas noltari at gmail.com
Thu Nov 20 19:10:16 EST 2014


This fixes system/system not properly loading due to themes being null.

Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js
index 040f1e5..a92aaeb 100644
--- a/luci2/htdocs/luci2/luci2.js
+++ b/luci2/htdocs/luci2/luci2.js
@@ -5190,13 +5190,15 @@ function LuCI2()
 			{
 				delete validation.message;
 
-				if ((val.length == 0 && !d.opt))
-				{
-					rv = d.self.setError($elem, L.tr('Field must not be empty'));
-				}
-				else if (val.length > 0 && !vstack[0].apply(val, vstack[1]))
-				{
-					rv = d.self.setError($elem, validation.message, vstack[1]);
+				if (val) {
+					if ((val.length == 0 && !d.opt))
+					{
+						rv = d.self.setError($elem, L.tr('Field must not be empty'));
+					}
+					else if (val.length > 0 && !vstack[0].apply(val, vstack[1]))
+					{
+						rv = d.self.setError($elem, validation.message, vstack[1]);
+					}
 				}
 				else
 				{
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list