Error report reports me some errors in my game - but the problem that they just can't exist under normal conditions!

So, I have looked at my game’s error report panel. And got this errors:


This’s errors I need help with. They are essentially the same - just diffirent lines - code same:

local Corner1 = workspace.CurrentCamera:ViewportPointToRay(0, 0, 1).Direction
local Corner2 = workspace.CurrentCamera:ViewportPointToRay(workspace.CurrentCamera.ViewportSize.X, 0, 1).Direction
local Depth = math.random(30, 80)
local Start = workspace.CurrentCamera.CFrame * CFrame.new(math.random(Corner2.X*Depth, Corner1.X*Depth), Corner1.Y*Depth+10, -Corner1.Z*Depth) * CFrame.Angles(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))

This tells me that Corner2.X > Corner1.X but in which case this may be true?

Corner2.X will always be greater than Corner1.X since it’s the actual ViewportSize of the camera which is in pixels. The only time Corner2.X would NOT be greater than Corner1.X is when the ViewportSize hasn’t be set by the Camera yet. To fix this error, you should switch Corner1 and Corner2 in your math.random call.