Skip to content

DCS-GRPC Issue logging warning when category could not be detected and :getID() is nill #285

@dutchie031

Description

@dutchie031

For some reason for some objects :getID() is not available anymore.
This causes DCS-gRPC to error instead of log a warning and return nil.

Proposed fix is to check if .getID is available and log that or log the ID as "nil" otherwise to specify there is no ID.
This should not affect the clients or logic, merely makes sure the exporter doesn't error, but returns nil as expected in the code.

2025-07-16 01:15:46.423 ERROR   SCRIPTING (Main): [GRPC] Error in event handler: [string "<saved games>\Scripts\DCS-gRPC\methods\mission.lua"]:25: attempt to call method 'getID' (a nil value)
stack traceback:
	[string "<saved games>\Scripts\DCS-gRPC\methods\mission.lua"]:25: in function 'exporter'
	[string "<saved games>\Scripts\DCS-gRPC\methods\mission.lua"]:83: in function <[string "<saved games>\Scripts\DCS-gRPC\methods\mission.lua"]:63>
	(tail call): ?
	[C]: in function 'xpcall'
	[string "<saved games>\Scripts\DCS-gRPC\grpc.lua"]:238: in function 'onEvent'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions