{"name":"isNull","operator":null,"title":"isNull","type":"command","url":"https://community.bistudio.com/wiki/isNull","revid":370892,"updated":"2025-02-21T10:44:05Z","groups":["Variables"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"description":"Checks whether the tested item is null.\n\nWhich null type the item has to be equal to depends on the type of game entity tested:\n\n|  |  |  |  |  |  |  |  |  |  |  |\n|---|---|---|---|---|---|---|---|---|---|---|\n| Type | Object | Group | Control | Display | Location | Task | Script | Config | Diary Record | Team Member |\n| Null value | objNull | grpNull | controlNull | displayNull | locationNull | taskNull | scriptNull | configNull | diaryRecordNull | teamMemberNull |\n| Since | Operation Flashpoint v1.00 | Armed Assault v1.00 | Arma 2 v1.00 | Arma 3 v1.30 | Arma 3 v1.54 | Arma 3 v2.00 | Arma 3 v2.10 |  |  |  |\n\n> [!IMPORTANT]\n>","syntaxes":[{"syntax":"isNull entity","since":null,"effect":null,"exec":null,"params":[{"name":"entity","type":null,"optional":false,"default":null,"description":"Object, Control, Display, Group, Location, Task, Script Handle, Config or Diary Record","types":["Object","Control","Display","Group","Location","Task","Script Handle","Config","Diary Record"],"since":null,"text":"entity: Object, Control, Display, Group, Location, Task, Script Handle, Config or Diary Record"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"unary","operator":null,"left":null,"right":{"text":"entity","types":["Object","Control","Display","Group","Location","Task","Script Handle","Config","Diary Record"]}}],"examples":[{"text":"```sqf\nif (isNil \"obj\") exitWith { hint \"obj variable is undefined\" };\n\nif (isNull obj) then\n{\n    hint \"obj variable is defined but is null\";\n}\nelse\n{\n    hint \"obj variable is defined and is not null\";\n};\n```","code":["if (isNil \"obj\") exitWith { hint \"obj variable is undefined\" };\n\nif (isNull obj) then\n{\n\thint \"obj variable is defined but is null\";\n}\nelse\n{\n\thint \"obj variable is defined and is not null\";\n};"]},{"text":"Diary Record support before Arma 3 v2.00:\n\n```sqf\nprivate _nullRecord = objNull createDiaryRecord []; // wrong parameters = failure to create a record = null value\nprivate _createdRecord = player createDiaryRecord [\"Diary\", [\"title\", \"description\"]];\nif (_createdRecord isEqualTo _nullRecord) then { hint \"Failed\" };\n```\n\nTeam Member support before Arma 3 v2.10:\n\n```sqf\nprivate _isNull = _teamMember isEqualTo teamMemberNull;\n```","code":["private _nullRecord = objNull createDiaryRecord []; // wrong parameters = failure to create a record = null value\nprivate _createdRecord = player createDiaryRecord [\"Diary\", [\"title\", \"description\"]];\nif (_createdRecord isEqualTo _nullRecord) then { hint \"Failed\" };","private _isNull = _teamMember isEqualTo teamMemberNull;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["controlNull","displayNull","grpNull","locationNull","objNull","taskNull","teamMemberNull","scriptNull","configNull","typeName"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Variables","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}