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

  • 7
  • Problem
  • Updated 1 year ago
  • Solved
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

  • 4835 Posts
  • 1334 Reply Likes

Posted 1 year ago

  • 7
Photo of Chinoy Gupta

Chinoy Gupta, Employee

  • 83 Posts
  • 38 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@@__".

Photo of Rikk Flohr

Rikk Flohr, Official Rep

  • 6689 Posts
  • 1507 Reply Likes
Official Response

The Lightroom Classic CC was updated today and contains a fix for this issue. Please download the new version and give it a try and let us know how it works.