Lightroom SDK: LrApplication.developPresetFolders() returns buggy fake folders

  • 7
  • Problem
  • Updated 4 weeks ago
  • Acknowledged
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):

The workaround is to detect such bogus objects by calling folder:getPath() and trapping any error with pcall().


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:

Photo of John R. Ellis

John R. Ellis, Champion

  • 3734 Posts
  • 977 Reply Likes

Posted 1 month ago

  • 7
Photo of Chinoy Gupta

Chinoy Gupta, Employee

  • 49 Posts
  • 18 Reply Likes
Official Response
Hi John,

Thanks for reporting this. It is indeed a bug in 7.5 and we will fix it in next release. In the meanwhile, as you mentioned you can use pcall to trap the error or you can skip any folder name with value "__@@ThisIsASeparatorRow@@__".