-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Description
The following code caused a NullPointerException because gainControl was null, so I had to add code to test for null before using it.
/**
* This method returns the camera min and max gain setting.
*
* @return array containing min and max gain values, null if unsuccessful.
*/
public int[] getGainSetting()
{
int[] gains = null;
if (visionPortal.getCameraState() == VisionPortal.CameraState.STREAMING)
{
GainControl gainControl = visionPortal.getCameraControl(GainControl.class);
if (gainControl != null)
{
gains = new int[2];
gains[0] = gainControl.getMinGain();
gains[1] = gainControl.getMaxGain();
}
// TODO: Figure out why gainControl is NULL?!
}
return gains;
}
Metadata
Metadata
Assignees
Labels
No labels