nodpc / jn-npp-plugin

Automatically exported from code.google.com/p/jn-npp-plugin
0 stars 0 forks source link

error message 'langs[...] is null or not an object' #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install jN plugins package
2. open a file with customed suffix like '.jsxxx'
3. toggle tab to the file

What is the expected output?
error message 'Editor.langs[..] is null or not an object' shown on a dialog

What version of the product are you using? On what operating system?
npp 5.9.8
jN 1.0.34

I tried to debug this issue and find the problem.
jN plugin XML.js will cause this issue at line 4.

script snippet:
this.menu.disabled = langs[v.lang].toLowerCase()!="xml";

while file type not in langs list, the langs[v.lang] means undefined, so it is 
no method 'toLowerCase'.

I modified the line.

script snippet:
this.menu.disabled = !langs[v.lang] || (langs[v.lang] && 
langs[v.lang].toLowerCase() != "xml");

then it works.

Original issue reported on code.google.com by Aluc...@gmail.com on 11 Oct 2013 at 7:29

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r93.

Original comment by eugen.kr...@gmail.com on 12 Oct 2013 at 11:38