Strange nil value problem


hi everyone,

 

i've been working on lightroom plugin , have interesting problem, values should not nil prior export (ie must true export button enabled) nil afterwards. happens users of plugin, not all, , tricky thing can't reproduce myself.

 

the user selects event photos etc via dialog , exports.

there observer function on several variables check if chosen parameters correct/sane etc.

 

after checking several variables last 1 :

 

function dialogsections.updatecantexportstatus( propertytable )

 

..

.

 

if propertytable.loggedin , propertytable.finishedloading , propertytable.chosenevent , (propertytable.category or propertytable.auto_create) then

                         propertytable.lr_cantexportbecause = nil

                         propertytable.lr_canexport = true

        return

end

 

the problem occurs later in processrenderedphotos function.

i copy of propertytable via:

 

function ftpuploader.processrenderedphotos(functioncontext, exportcontext)

          local exportsession = exportcontext.exportsession

          local exportparams = exportcontext.propertytable

and afterwards in code, users following error triggered:

if not exportparams.chosenevent then

                              lrerrors.throwusererror( loc "$$$/upload/errors/invalidparameters=please choose event dialog before exporting." )

                              return

          end

 

so seems chosenevent variable nil, when had not nil in order export button able pressed in first place. button enabled/disabled state working correctly.

 

right assume propertytable variables visible between dialog being displayed , export taking place?

 

the fact happens people makes me think kind of race condition, last if-clause place export button set enabled.

 

if has seen kind of thing happening before, i'd appreciate help!

 

best regards,

 

chris.

hi chris,

 

i won't able - i've never experienced such strange behavior. couple comments fwiw:

 

default state of cantexportbecause false (i.e. *can* export).

 

so if updatecantexportbecause has not been called, case when 1 export, despite chosenevent being false.

 

for example, if you've loaded lightroom, choose export via preset chosen on context menu, export dialog box never have been displayed, , start-dialog never have been called.

 

let know how turns out, ok?

 

rob



More discussions in Lightroom SDK


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support