Cannot read property 'split' of undefined
-
Paging @ben_lubar. I see a lot of these in the logs:
2018-07-13T19:21:21.759Z [5332] - error: [4567/5332] message=Cannot read property 'split' of undefined, stack=TypeError: Cannot read property 'split' of undefined at findUpstreams (/usr/src/app/plugins/nodebb-plugin-tdwtf-customizations/index.js:236:11) at /usr/src/app/plugins/nodebb-plugin-tdwtf-customizations/index.js:267:21 at /usr/src/app/node_modules/async/dist/async.js:3110:16 at replenish (/usr/src/app/node_modules/async/dist/async.js:1011:17) at /usr/src/app/node_modules/async/dist/async.js:1016:9 at Object.eachLimit$1 (/usr/src/app/node_modules/async/dist/async.js:3196:24) at /usr/src/app/plugins/nodebb-plugin-tdwtf-customizations/index.js:266:10 at /usr/src/app/src/database/postgres/sorted.js:171:11 at Query.client.query (/usr/src/app/node_modules/pg/node_modules/pg-pool/index.js:262:18) at Query.handleReadyForQuery (/usr/src/app/node_modules/pg/lib/query.js:126:10) at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:163:19) at emitOne (events.js:116:13) at Connection.emit (events.js:211:7) at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:123:12) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at addChunk (_stream_readable.js:263:12) at readableAddChunk (_stream_readable.js:250:11) at Socket.Readable.push (_stream_readable.js:208:10) at TCP.onread [as _originalOnread] (net.js:597:20) at TCP.onread (/usr/src/app/node_modules/async-listener/glue.js:188:31)
-
Oh, thanks, @julianlam. Really nice of you to break our plugins by giving us first-party ransomware in our own database.
Thankfully, it only affects the admin page.
-
@ben_lubar
.ransomware ???
-
wat
-
@cabrito said in Cannot read property 'split' of undefined:
@ben_lubar
.ransomware ???"Let's make the IP address table more secure by SHA1-hashing everything!"
-
@ben_lubar said in Cannot read property 'split' of undefined:
var hit = upstreamIPs[hash % upstreamIPs.length]; if (hit.split(/:/)[0] === upstreamIP && hits.indexOf(hit) === -1) { ...
C++ has
at()
for checking undefined key/offset access, andoperator []
for the unchecked case. Even Pretty Horrible Proglang throws a fit when you access an array index that's not set. Why won't ACMEScript?