Fix two possible nullptr deref

master
jvoisin 5 years ago
parent dc5a3020d3
commit d4002ef6ce
  1. 4
      airsonic-main/src/main/java/org/airsonic/player/controller/CoverArtController.java
  2. 5
      airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java

@ -95,7 +95,9 @@ public class CoverArtController implements LastModified {
public long getLastModified(HttpServletRequest request) {
CoverArtRequest coverArtRequest = createCoverArtRequest(request);
// LOG.info("getLastModified - " + coverArtRequest + ": " + new Date(result));
if (null == coverArtRequest) {
return -1L;
}
return coverArtRequest.lastModified();
}

@ -2115,7 +2115,10 @@ public class SubsonicRESTController {
command.setShareRole(getBooleanParameter(request, "shareRole", u.isShareRole()));
int maxBitRate = getIntParameter(request, "maxBitRate", s.getTranscodeScheme().getMaxBitRate());
command.setTranscodeSchemeName(TranscodeScheme.fromMaxBitRate(maxBitRate).name());
TranscodeScheme transcodeScheme = TranscodeScheme.fromMaxBitRate(maxBitRate);
if (transcodeScheme != null) {
command.setTranscodeSchemeName(transcodeScheme.name());
}
if (hasParameter(request, "password")) {
command.setPassword(decrypt(getRequiredStringParameter(request, "password")));

Loading…
Cancel
Save