From ab03526620ba6447683a2306e241f62daf030574 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 1 May 2019 08:52:09 +0000 Subject: [PATCH] Fix two NULL-deref --- .../main/java/org/airsonic/player/controller/HLSController.java | 2 +- .../org/airsonic/player/controller/StatusChartController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/HLSController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/HLSController.java index 18ace0cb..02966123 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/HLSController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/HLSController.java @@ -71,7 +71,7 @@ public class HLSController { response.setHeader("Access-Control-Allow-Origin", "*"); - int id = ServletRequestUtils.getIntParameter(request, "id"); + int id = ServletRequestUtils.getIntParameter(request, "id", 0); MediaFile mediaFile = mediaFileService.getMediaFile(id); Player player = playerService.getPlayer(request, response); String username = player.getUsername(); diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java index dffbcea9..71844041 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java @@ -63,7 +63,7 @@ public class StatusChartController extends AbstractChartController { @RequestMapping(method = RequestMethod.GET) public synchronized ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { String type = request.getParameter("type"); - int index = ServletRequestUtils.getIntParameter(request, "index"); + int index = ServletRequestUtils.getIntParameter(request, "index", 0); List statuses = Collections.emptyList(); if ("stream".equals(type)) {