openvidu-call: Fixed possible NullPointerException

This commit is contained in:
csantosm 2022-08-29 12:43:06 +02:00
parent 5d17a4b930
commit c6307709ca

View File

@ -111,11 +111,11 @@ public class SessionController {
} catch (OpenViduJavaClientException | OpenViduHttpException e) {
if (Integer.parseInt(e.getMessage()) == 501) {
if (e.getMessage() != null && Integer.parseInt(e.getMessage()) == 501) {
System.err.println("OpenVidu Server recording module is disabled");
response.put("recordingEnabled", false);
return new ResponseEntity<>(response, HttpStatus.OK);
} else if (Integer.parseInt(e.getMessage()) == 401) {
} else if (e.getMessage() != null && Integer.parseInt(e.getMessage()) == 401) {
System.err.println("OpenVidu credentials are wrong.");
return new ResponseEntity<>(null, HttpStatus.UNAUTHORIZED);