Skip to content

Calling setHTML without valid HTML causes TypeError crash #1449

@Miserlou

Description

@Miserlou

getHtml, getText and setText all work, however, setHTML causes a fatal crash, if the HTML is invalid. Here's the traceback:

[2013-02-04 16:43:51.682] [INFO] API - REQUEST, v1:setHTML, {"apikey":"XXX","html":"asdf","padID":"gsBqktafF5JzdjF"}

[2013-02-04 16:43:51.697] [ERROR] console - TypeError: Object [ null ] has no method 'getAttribute'
at Object.nodeAttr (/home/tuttle/Projects/etherpad-lite/src/static/js/contentcollector.js:69:16)
at Object.collectContent (/home/tuttle/Projects/etherpad-lite/src/static/js/contentcollector.js:378:23)
at Object.setPadHTML (/home/tuttle/Projects/etherpad-lite/src/node/utils/ImportHtml.js:41:6)
at /home/tuttle/Projects/etherpad-lite/src/node/db/API.js:275:16
at Object.getPad (/home/tuttle/Projects/etherpad-lite/src/node/db/PadManager.js:94:5)
at /home/tuttle/Projects/etherpad-lite/src/node/db/API.js:625:18
at Object.callback (/home/tuttle/Projects/etherpad-lite/src/node/db/PadManager.js:119:7)
at /home/tuttle/Projects/etherpad-lite/src/node_modules/ueberDB/CloneAndAtomicLayer.js:95:17
at /home/tuttle/Projects/etherpad-lite/src/node_modules/ueberDB/CacheAndBufferLayer.js:183:7
at [object Object].get (/home/tuttle/Projects/etherpad-lite/src/node_modules/ueberDB/dirty_db.js:48:3)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions