diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index 9311b0e..d07f6a2 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -312,7 +312,7 @@ export default { try { imgList = eval(result) } catch (error) {} - if (imgList.length) firtImg = imgList[0] + if (imgList && imgList.length) firtImg = imgList[0] // 如果是下载图片的代码,则要显示图片和运行结果,不用显示对错,换成显示下载图片 if (photo) { this.isError = '' // 对错隐藏