P: SDK: LrApplication.developPresetFolders() returns buggy fake folders
In LR 7.5, the array returned by LrLrApplication.developPresetFolders() includes buggy fake folder objects intended to represent separator rows in the user interface. Invoking folder:getPath() on one of these bogus objects raises the internal error:
?:0: attempt to index field '_pathForFolder' (a nil value)
This affects any plugin that attempts to access the develop preset folders. In particular, it broke a DxO plugin and my own Fix Presets plugin (which fixes many other preset bugs):
https://forums.adobe.com/thread/2528220
https://feedback.dxo.com/t/export-to-dxo-broken-after-update-to-lr-7-5/4514
https://forums.adobe.com/thread/2527232
http://www.johnrellis.com/lightroom/fixpresets.htm
The workaround is to detect such bogus objects by calling folder:getPath() and trapping any error with pcall().
Details:
Here are the results of calling folder:getName() on the array of preset folders:
Note that the bogusly named folders correspond to the presence of separate rows in Develop's Preset panel.
Here's the result of calling folder:getPath() on the second (bogus) array element:
