fix: null pointer bug in cheat-sheet

This commit is contained in:
Zhicheng Wang 2017-03-03 16:33:49 +08:00
parent 71eb6213b9
commit 3dfa29b36d
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,10 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true';
* @param container * @param container
*/ */
function processContainer(container) { function processContainer(container) {
if (!container) {
return;
}
var nodes = container.querySelectorAll('p,h1,h2,h3,h4,h5,h6,header,a'); var nodes = container.querySelectorAll('p,h1,h2,h3,h4,h5,h6,header,a');
for(var i in nodes) { for(var i in nodes) {
(function(node) { (function(node) {