* attempt to call a nil value (method 'isNotNull')

For plugin authors to discuss plugin programming
Post Reply
avatar
KFN
Superstar
Posts: 295
Joined: 20 Jun 2021 01:00
Family Historian: V7

attempt to call a nil value (method 'isNotNull')

Post by KFN »

I don't understand the above error in my Lua Code!

The error point to the "if" statement.

I

Code: Select all

local ptrMother = fhNewItemPtr();
ptrMother = fhGetItemPtr(ptrIndi,"~.~MOTH>")
if ptrMother:isNotNull() then
I get the same error with "if ptrMother:isNull() then" as well!

The Debug clearly shows the ptrMother as (null) so the pointer is defined.

I want to check if the "Mother Pointer" is null so I avoid trying to get other data (and getting errors) based on the pointer later on!
User avatar
Mark1834
Megastar
Posts: 2534
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: attempt to call a nil value (method 'isNotNull')

Post by Mark1834 »

IsNotNull()) - Lua and FH function names are case-sensitive.
Mark Draper
avatar
KFN
Superstar
Posts: 295
Joined: 20 Jun 2021 01:00
Family Historian: V7

Re: attempt to call a nil value (method 'isNotNull')

Post by KFN »

Duh!
Post Reply