Skip to content

CPPIGetOwner is not checked against nil #3476

@DBotThePony

Description

@DBotThePony

Example:

if CPPI and v:CPPIGetOwner():GetName() ~= nick then

Which cause next error:

[Wiremod] lua/wire/client/text_editor/wire_expression2_editor.lua:1466: attempt to index a nil value

1. DoClick - lua/wire/client/text_editor/wire_expression2_editor.lua:1466
2. unknown - lua/vgui/dlabel.lua:253 (x7)

https://gitlab.com/DBotThePony/DLib/-/issues/154

As per CPPI specs, which DPP/2 follows:

Image

Solution should be a simple IsValid(entity:CPPIGetOwner()) call to see if entity is owned by anyone

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