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.
This commit is contained in:
angusiguess 2017-10-09 10:43:44 -03:00 committed by Roman Volosovskyi
parent baccb01334
commit 8b1bf510ef
1 changed files with 2 additions and 1 deletions

View File

@ -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