From ae04fddd68e79f35b77891a9f56b1a5012458edf Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 23 Feb 2018 17:54:16 -0800 Subject: [PATCH] add NPE check for makeProps --- .../pseudoVirtualList/PseudoVirtualListLazyItem.html | 6 ++++-- routes/_components/virtualList/VirtualListLazyItem.html | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html b/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html index 0e3046fd..7b6a6ac5 100644 --- a/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html +++ b/routes/_components/pseudoVirtualList/PseudoVirtualListLazyItem.html @@ -17,8 +17,10 @@ async oncreate() { let makeProps = this.get('makeProps') let key = this.get('key') - let props = await makeProps(key) - this.set({ props: props }) + if (makeProps) { + let props = await makeProps(key) + this.set({props: props}) + } }, components: { PseudoVirtualListItem diff --git a/routes/_components/virtualList/VirtualListLazyItem.html b/routes/_components/virtualList/VirtualListLazyItem.html index a649bff8..b01231a0 100644 --- a/routes/_components/virtualList/VirtualListLazyItem.html +++ b/routes/_components/virtualList/VirtualListLazyItem.html @@ -12,8 +12,10 @@ async oncreate() { let makeProps = this.get('makeProps') let key = this.get('key') - let props = await makeProps(key) - this.set({ props: props }) + if (makeProps) { + let props = await makeProps(key) + this.set({props: props}) + } }, components: { VirtualListItem