@@ -338,25 +338,31 @@ private static void sign(AppImageBuildEnv<MacApplication, MacApplicationLayout>
338
338
339
339
private static void writeCFBundleDocumentTypes (XMLStreamWriter xml ,
340
340
MacApplication app ) throws XMLStreamException , IOException {
341
- writeKey (xml , "CFBundleDocumentTypes" );
342
- for (var fa : app .fileAssociations ().toList ()) {
343
- writeArray (xml , toXmlConsumer (() -> {
344
- writeDict (xml , toXmlConsumer (() -> {
345
- addFaToCFBundleDocumentTypes (xml , app , (MacFileAssociation ) fa );
341
+ final var fas = app .fileAssociations ().toList ();
342
+ if (!fas .isEmpty ()) {
343
+ writeKey (xml , "CFBundleDocumentTypes" );
344
+ for (var fa : fas ) {
345
+ writeArray (xml , toXmlConsumer (() -> {
346
+ writeDict (xml , toXmlConsumer (() -> {
347
+ addFaToCFBundleDocumentTypes (xml , app , (MacFileAssociation ) fa );
348
+ }));
346
349
}));
347
- }));
350
+ }
348
351
}
349
352
}
350
353
351
354
private static void writeUTExportedTypeDeclarations (XMLStreamWriter xml ,
352
355
MacApplication app ) throws XMLStreamException , IOException {
353
- writeKey (xml , "UTExportedTypeDeclarations" );
354
- for (var fa : app .fileAssociations ().toList ()) {
355
- writeArray (xml , toXmlConsumer (() -> {
356
- writeDict (xml , toXmlConsumer (() -> {
357
- addFaToUTExportedTypeDeclarations (xml , app , (MacFileAssociation ) fa );
356
+ final var fas = app .fileAssociations ().toList ();
357
+ if (!fas .isEmpty ()) {
358
+ writeKey (xml , "UTExportedTypeDeclarations" );
359
+ for (var fa : fas ) {
360
+ writeArray (xml , toXmlConsumer (() -> {
361
+ writeDict (xml , toXmlConsumer (() -> {
362
+ addFaToUTExportedTypeDeclarations (xml , app , (MacFileAssociation ) fa );
363
+ }));
358
364
}));
359
- }));
365
+ }
360
366
}
361
367
}
362
368
0 commit comments