[vlc-commits] macosx: fix handling of null sub category items in prefs tree construction

Lyndon Brown git at videolan.org
Fri Oct 2 07:18:21 CEST 2020


vlc | branch: master | Lyndon Brown <jnqnfe at gmail.com> | Thu Apr 25 04:11:43 2019 +0100| [7c2f535afe995702fe6f7dd2bb17820541006caa] | committer: Felix Paul Kühne

macosx: fix handling of null sub category items in prefs tree construction

subCategoryItem would be null if:
 a) a plugin author neglected to place a set_category() call before one
    or more options.
 b) the first or only subcat targetted by a plugin is a general one.

there are actual examples of A with a handful of in-tree plugins (to be
fixed in a subsequent commit).

there are multiple in-tree modules which target general subcats,
including various logger and keystore plugins.

Signed-off-by: Felix Paul Kühne <felix at feepk.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c2f535afe995702fe6f7dd2bb17820541006caa
---

 modules/gui/macosx/preferences/prefs.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/preferences/prefs.m b/modules/gui/macosx/preferences/prefs.m
index f74afc9752..a8847e7189 100644
--- a/modules/gui/macosx/preferences/prefs.m
+++ b/modules/gui/macosx/preferences/prefs.m
@@ -535,7 +535,7 @@
                 }
             }
             else if (!module_is_main(p_module) && (CONFIG_ITEM(configType) || configType == CONFIG_SECTION)) {
-                if (![[subCategoryItem children] containsObject: pluginItem]) {
+                if (subCategoryItem && ![[subCategoryItem children] containsObject: pluginItem]) {
                     [[subCategoryItem children] addObject:pluginItem];
                 }
 



More information about the vlc-commits mailing list