Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I have a function like this

131 parameterValueList = function(xml) {
132 var e, err, j, len, name, ref1, value, valueList, valueType;
133 valueList = [];
134 ref1 = xml.find('ParameterValueStruct');
135 for (j = 0, len = ref1.length; j < len; j++) {
136 e = ref1[j];
137 valueType = e.get('Value').attr('type').value().trim();
138 name = e.get('Name').text().trim();
139 value = e.get('Value').text().trim();
140 try {
141 switch (valueType) {
142 case 'xsd:boolean':
143 value = Boolean(JSON.parse(value));
144 break;
145 case 'xsd:unsignedInt':
146 value = JSON.parse(value);
147 break;
148 case 'xsd:int':
149 value = JSON.parse(value);
150 }
151 } catch (_error) {
152 err = _error;
153 value = null;
154 }
155 valueList.push([name, value, valueType]);
156 }
157 return valueList;
158 };



My error is

util.error: Use console.error instead
2015-07-10T05:10:12.082Z - TypeError: Cannot read property 'value' of null
at parameterValueList (/opt/genieacs/lib/soap.js:137:44)
at acsInform (/opt/genieacs/lib/soap.js:292:20)
at Object.exports.request (/opt/genieacs/lib/soap.js:425:39)
at /opt/genieacs/lib/cwmp.js:638:26
at getSession (/opt/genieacs/lib/cwmp.js:569:12)
at IncomingMessage.<anonymous> (/opt/genieacs/lib/cwmp.js:636:12)
at IncomingMessage.emit (events.js:104:17)
at _stream_readable.js:908:16
at process._tickDomainCallback (node.js:381:11)

Can any one please suggest me how to solve this issue.
Posted

1 solution

If you don't know Javascript, then you shouldn't be using it!

So start with a Javascript tutorial - Google[^] has loads.
Here's one: http://www.w3schools.com/js/[^]

And learn the language before you try to do any work in it. Just grabbing code at random from the internet and bolting it into your website is not a good idea...you need to understand how it works and that means understanding the language as well.
 
Share this answer
 
Comments
Member 11827793 10-Jul-15 9:23am    
I appreciate your advice . But now I am in a hurry moment,I think if you can give me the solution I think I can understand as well to do so. Actually I want to communicate one CPESIM with freeware genieacs and in my case CPE is already sent an informRequest but I am not getting any response from genieacs . So somewhere if you have configured any CPE with genieacs in linux platform please suggest me the required steps . I mean to say that if you have any docs regarding how to communicate a CPE with genieacs please send me through mail mail-id:-mahendra.titun@gmail.com
So please try to resolve this issue bcoz it is very important for me right now. Please give some importance .

Thanks in Advance
Mahendra
OriginalGriff 10-Jul-15 10:03am    
And you will always be "in a hurry moment" until you knuckle down and learn it.
You won't be able to sort it out yourself, so you will rely on others to do your work for you - which isn't fair on anyone, is it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900