Skip to content

Commit

Permalink
Validate projection id
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
britzl committed Aug 22, 2018
1 parent ad0a8e3 commit 593bfc3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions orthographic/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ end
function M.use_projector(camera_id, projector_id)
assert(camera_id, "You must provide a camera id")
assert(projector_id, "You must provide a projector id")
assert(projectors[projector_id], "Unknown projection id")
local camera = cameras[camera_id]
msg.post(camera.url, "use_projection", { projection = projector_id })
end
Expand Down Expand Up @@ -126,6 +127,7 @@ end
local function calculate_projection(camera_id)
local camera = cameras[camera_id]
local projector_id = go.get(camera.url, "projection")
assert(projectors[projector_id], "Unknown projection id")
local near_z = go.get(camera.url, "near_z")
local far_z = go.get(camera.url, "far_z")
local zoom = go.get(camera.url, "zoom")
Expand Down

0 comments on commit 593bfc3

Please sign in to comment.