The point of the code is to only drill turfs, and things on turfs.  isnull(A.loc) would detect anything with null location, or areas.  Screen objects have null location, but items in your inventory do not.