diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/DocumentAdapter.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/DocumentAdapter.java index ae187769..c9164fe2 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/DocumentAdapter.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/DocumentAdapter.java @@ -16,7 +16,12 @@ public class DocumentAdapter extends RecyclerView.Adapter documentMetas; + public DocumentAdapter(List documentMetas) { + // nullの場合に例外を発生させる + if (documentMetas == null) { + throw new IllegalArgumentException("DocumentMetas list cannot be null"); + } this.documentMetas = documentMetas; } @@ -31,6 +36,11 @@ public class DocumentAdapter extends RecyclerView.Adapter documentList = new ArrayList<>(); -// documentList.add("Document A"); -// documentList.add("Document B"); -// documentList.add("Document C"); - // Create and set the adapter DocumentAdapter adapter = new DocumentAdapter(metas); documentRecyclerView.setAdapter(adapter);