From 658b8f96312d52451dc5dda0717937e2b173cf91 Mon Sep 17 00:00:00 2001 From: vivchar Date: Fri, 19 Jan 2018 01:27:01 +0700 Subject: [PATCH] fixed NullPointerException --- gradle.properties | 4 ++-- .../RendererRecyclerViewAdapter.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8368377..72a43d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,8 +15,8 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -VERSION_NAME=2.4.0 -VERSION_CODE=25 +VERSION_NAME=2.4.1 +VERSION_CODE=26 GROUP=com.github.vivchar POM_DESCRIPTION=A single adapter with multiple view types for the whole project diff --git a/rendererrecyclerviewadapter/src/main/java/com/github/vivchar/rendererrecyclerviewadapter/RendererRecyclerViewAdapter.java b/rendererrecyclerviewadapter/src/main/java/com/github/vivchar/rendererrecyclerviewadapter/RendererRecyclerViewAdapter.java index 38c508d..34c6f92 100644 --- a/rendererrecyclerviewadapter/src/main/java/com/github/vivchar/rendererrecyclerviewadapter/RendererRecyclerViewAdapter.java +++ b/rendererrecyclerviewadapter/src/main/java/com/github/vivchar/rendererrecyclerviewadapter/RendererRecyclerViewAdapter.java @@ -84,7 +84,9 @@ public void onBindViewHolder(final ViewHolder holder, final int position, @Nulla } public void registerRenderer(@NonNull final ViewRenderer renderer) { - renderer.setContext(mContext); + if (mContext != null) { + renderer.setContext(mContext); + } final Type type = renderer.getType(); if (!mTypes.contains(type)) {