From 8b1bf510ef547def81906e29e6dc05e0b31bf84a Mon Sep 17 00:00:00 2001 From: angusiguess Date: Mon, 9 Oct 2017 10:43:44 -0300 Subject: [PATCH] Fix precondition for flat-list The flat-list component handles the nil case but the precondition does not. This is currently causing transaction list failures when the list of unsigned transactions is empty. --- src/status_im/components/list/views.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/status_im/components/list/views.cljs b/src/status_im/components/list/views.cljs index 99196eb546..c7509292f3 100644 --- a/src/status_im/components/list/views.cljs +++ b/src/status_im/components/list/views.cljs @@ -86,7 +86,8 @@ "A wrapper for FlatList. See https://facebook.github.io/react-native/docs/flatlist.html" [{:keys [data render-fn empty-component] :as props}] - {:pre [(sequential? data)]} + {:pre [(or (nil? data) + (sequential? data))]} (if (and (empty? data) empty-component) ;; TODO(jeluard) remove when native :ListEmptyComponent is supported empty-component