diff options
author | lucicam <luci1093@gmail.com> | 2021-04-02 16:16:40 +0300 |
---|---|---|
committer | lucicam <luci1093@gmail.com> | 2021-04-02 17:11:30 +0300 |
commit | c158a63a8af668eac20ed303b1f8c02b6831a983 (patch) | |
tree | 666b656c49c0b923d2b92bb699d9b2414a0f8ee7 /servers | |
parent | 86108679b39c9f04b638d47ec07c0345515b83a2 (diff) |
Fix crash caused by null parameter passed to CameraServer.add_feed()
Fixes #46181
CameraServer.add_feed() takes a CameraFeed object type as parameter.
Passing in another type of data while binding the method it will make
tha parameter null.
Added a check for null which returns from function and does not make the
engine crash anymore.
Diffstat (limited to 'servers')
-rw-r--r-- | servers/camera_server.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/camera_server.cpp b/servers/camera_server.cpp index b06f32417c..ee4a2e148b 100644 --- a/servers/camera_server.cpp +++ b/servers/camera_server.cpp @@ -99,6 +99,8 @@ Ref<CameraFeed> CameraServer::get_feed_by_id(int p_id) { }; void CameraServer::add_feed(const Ref<CameraFeed> &p_feed) { + ERR_FAIL_COND(p_feed.is_null()); + // add our feed feeds.push_back(p_feed); |