Farmer's Feud: Null Field Type

Not asking for a solution for it but I was wondering how to deal with null values for tile placements, I’ll have my guy get the type of field at a certain square. However, if my opponent doesn’t put anything on that square my code breaks down and the duck gets mad because “null” is not a type of field. Does anyone have a solution?

When checking for a field, you can check if the field is null first before accessing the type,
fields without anything on them will be equal to null.

How do you check this? I tried to have an if statement for it but nothing seemed to work.

in JS

let fieldObjectExample = hero.whatAt("A5")
if(fieldObjectExample !== null){
   print("A5 is not empty!")