Skip to content

Commit d49f249

Browse files
committed
Issue #5925: Cannot read property 'content' of undefined CCEGLView.js:257
1 parent 07314d2 commit d49f249

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos2d/core/platform/CCEGLView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
254254
if(cc.sys.isMobile)
255255
viewportMetas["target-densitydpi"] = this._targetDensityDPI;
256256

257-
content = elems ? elems[0].content : "";
257+
content = (elems && elems.length>0) ? elems[0].content : "";
258258
for (var key in viewportMetas) {
259259
var pattern = new RegExp(key);
260260

0 commit comments

Comments
 (0)