Forráskód Böngészése

fix(program): the new program cannot be edited

Casper Dai 3 éve
szülő
commit
4eb445e4b3
1 módosított fájl, 4 hozzáadás és 4 törlés
  1. 4 4
      src/views/bigscreen/ast/core/utils.js

+ 4 - 4
src/views/bigscreen/ast/core/utils.js

@@ -42,7 +42,7 @@ export function create (node) {
 function compatibleProcessing (widget) {
   switch (widget.type) {
     case WidgetType.IMAGE:
-      widget.sources.forEach(source => {
+      widget.sources?.forEach(source => {
         source.type = AssetType.IMAGE
         if (!source.duration) {
           Vue.set(source, 'duration', widget.interval)
@@ -50,16 +50,16 @@ function compatibleProcessing (widget) {
       })
       break
     case WidgetType.VIDEO:
-      widget.sources.forEach(source => {
+      widget.sources?.forEach(source => {
         source.type = AssetType.VIDEO
       })
       break
     default:
       if (!widget.type) {
-        widget.bgm.forEach(source => {
+        widget.bgm?.forEach(source => {
           source.type = AssetType.AUDIO
         })
-        widget.backgroundImage.forEach(source => {
+        widget.backgroundImage?.forEach(source => {
           source.type = AssetType.IMAGE
         })
       }