From d44e87ff81e6c82246cf0bd957e1543e29c90bf0 Mon Sep 17 00:00:00 2001 From: fuwa Date: Fri, 27 Dec 2019 11:07:39 +0000 Subject: [PATCH] fix a null access on rpcView --- cyberwow/lib/controller/rpc/rpcView.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cyberwow/lib/controller/rpc/rpcView.dart b/cyberwow/lib/controller/rpc/rpcView.dart index 7d80184..50977e1 100644 --- a/cyberwow/lib/controller/rpc/rpcView.dart +++ b/cyberwow/lib/controller/rpc/rpcView.dart @@ -162,7 +162,8 @@ Map getInfoView(Map x) { (k,v) => _remove.contains(k) ); - final Map _hashRate = {'hash_rate': _filteredInfo['difficulty'] / 300}; + final int _difficulty = _filteredInfo['difficulty'] ?? 0; + final Map _hashRate = {'hash_rate': _difficulty / 300}; final Map _ammendedInfo = { ..._filteredInfo, ..._hashRate,