mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-03 23:55:08 +00:00
Fix division by 0
This commit is contained in:
@@ -133,6 +133,7 @@ class MprisReceiverPlayer {
|
|||||||
int getVolume() {
|
int getVolume() {
|
||||||
MediaController.PlaybackInfo info = controller.getPlaybackInfo();
|
MediaController.PlaybackInfo info = controller.getPlaybackInfo();
|
||||||
if (info == null) return 0;
|
if (info == null) return 0;
|
||||||
|
if (info.getMaxVolume() == 0) return 0;
|
||||||
return 100 * info.getCurrentVolume() / info.getMaxVolume();
|
return 100 * info.getCurrentVolume() / info.getMaxVolume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user