NPE guard.

This commit is contained in:
Johannes Mockenhaupt 2017-07-20 13:05:44 +02:00
parent d5bf5812b7
commit d85425e68b
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -109,6 +109,9 @@ public class ComboFragment extends Fragment implements View.OnClickListener {
statusText.setText(getPlugin().statusSummary);
if (getPlugin().isInitialized()) {
PumpState ps = getPlugin().pumpState;
if (ps == null) {
return;
}
boolean tbrActive = ps.tbrPercent != -1 && ps.tbrPercent != 100;
if (tbrActive) {
tbrPercentageText.setText("" + ps.tbrPercent + "%");