Commit 2c3a38ce authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

fix null errror in PrintersBloc

parent b061fa30
...@@ -302,26 +302,28 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> { ...@@ -302,26 +302,28 @@ class PrintersBloc extends Bloc<PrintersEvent, PrintersState> {
_printers[index] = Printer.fromMap(json.decode(response.body) as Map<String, dynamic>); _printers[index] = Printer.fromMap(json.decode(response.body) as Map<String, dynamic>);
if (_printers[index].status.toner_c > 100 || _printers[index].status.toner_c < 0) { if (_printers[index].status != null) {
_printers[index].status.toner_c = null; if (_printers[index].status.toner_c > 100 || _printers[index].status.toner_c < 0) {
} _printers[index].status.toner_c = null;
if (_printers[index].status.toner_m > 100 || _printers[index].status.toner_m < 0) { }
_printers[index].status.toner_m = null; if (_printers[index].status.toner_m > 100 || _printers[index].status.toner_m < 0) {
} _printers[index].status.toner_m = null;
if (_printers[index].status.toner_y > 100 || _printers[index].status.toner_y < 0) { }
_printers[index].status.toner_y = null; if (_printers[index].status.toner_y > 100 || _printers[index].status.toner_y < 0) {
} _printers[index].status.toner_y = null;
if (_printers[index].status.toner_k > 100 || _printers[index].status.toner_k < 0) { }
_printers[index].status.toner_k = null; if (_printers[index].status.toner_k > 100 || _printers[index].status.toner_k < 0) {
} _printers[index].status.toner_k = null;
if (_printers[index].status.tray_1 < 0) { }
_printers[index].status.tray_1 = null; if (_printers[index].status.tray_1 < 0) {
} _printers[index].status.tray_1 = null;
if (_printers[index].status.tray_2 < 0) { }
_printers[index].status.tray_2 = null; if (_printers[index].status.tray_2 < 0) {
} _printers[index].status.tray_2 = null;
if (_printers[index].status.tray_3 < 0) { }
_printers[index].status.tray_3 = null; if (_printers[index].status.tray_3 < 0) {
_printers[index].status.tray_3 = null;
}
} }
return; return;
......
name: blocs_astaprint name: blocs_astaprint
version: 1.2.0 version: 1.2.1
description: >- description: >-
Business Logic for the AStAPrint admin interface Business Logic for the AStAPrint admin interface
author: Leon Tappe <ltappe@asta.upb.de> author: Leon Tappe <ltappe@asta.upb.de>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment