@@ -86,21 +86,23 @@ function processOverlay(overlay: Transformation["overlay"]): string | undefined
8686 }
8787
8888 switch ( type ) {
89- case "text" :
90- entries . push ( "l-text" ) ;
91- {
92- const textOverlay = overlay as TextOverlay ;
93- if ( textOverlay . text ) {
94- entries . push ( `ie-${ encodeURIComponent ( safeBtoa ( textOverlay . text ) ) } ` ) ;
95- }
89+ case "text" : {
90+ const textOverlay = overlay as TextOverlay ;
91+ if ( ! textOverlay . text ) {
92+ return ;
9693 }
94+ entries . push ( "l-text" ) ;
95+ entries . push ( `ie-${ encodeURIComponent ( safeBtoa ( textOverlay . text ) ) } ` ) ;
96+ }
9797 break ;
9898 case "image" :
9999 entries . push ( "l-image" ) ;
100100 {
101101 const imageOverlay = overlay as ImageOverlay ;
102102 if ( imageOverlay . input ) {
103103 entries . push ( `i-${ imageOverlay . input } ` ) ;
104+ } else {
105+ return ;
104106 }
105107 }
106108 break ;
@@ -110,6 +112,8 @@ function processOverlay(overlay: Transformation["overlay"]): string | undefined
110112 const videoOverlay = overlay as VideoOverlay ;
111113 if ( videoOverlay . input ) {
112114 entries . push ( `i-${ videoOverlay . input } ` ) ;
115+ } else {
116+ return ;
113117 }
114118 }
115119 break ;
@@ -119,6 +123,8 @@ function processOverlay(overlay: Transformation["overlay"]): string | undefined
119123 const subtitleOverlay = overlay as SubtitleOverlay ;
120124 if ( subtitleOverlay . input ) {
121125 entries . push ( `i-${ subtitleOverlay . input } ` ) ;
126+ } else {
127+ return ;
122128 }
123129 }
124130 break ;
@@ -129,6 +135,8 @@ function processOverlay(overlay: Transformation["overlay"]): string | undefined
129135 const solidColorOverlay = overlay as SolidColorOverlay ;
130136 if ( solidColorOverlay . color ) {
131137 entries . push ( `bg-${ solidColorOverlay . color } ` ) ;
138+ } else {
139+ return ;
132140 }
133141 }
134142 break ;
@@ -182,10 +190,10 @@ function constructTransformationString(transformation: Transformation[] | undefi
182190
183191 if ( key === "overlay" && typeof value === "object" ) {
184192 var rawString = processOverlay ( value as Transformation [ "overlay" ] ) ;
185- if ( rawString ) {
193+ if ( rawString && rawString . trim ( ) !== "" ) {
186194 parsedTransformStep . push ( rawString ) ;
187- continue ;
188195 }
196+ continue ; // Always continue as overlay is processed.
189197 }
190198
191199 var transformKey = transformationUtils . getTransformKey ( key ) ;
0 commit comments