pdr: pldm_pdr_find_record_by_type(): Exit early if repo is NULL

Finding a record may already fail and result in a NULL return value.
Improve assert() safety by returning NULL if the provided repo pointer
is NULL.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I0df1e329b8e0e546103358d4ef32e2074670879b
diff --git a/src/pdr.c b/src/pdr.c
index 65b7e5c..c350177 100644
--- a/src/pdr.c
+++ b/src/pdr.c
@@ -218,6 +218,9 @@
 			     uint32_t *size)
 {
 	assert(repo != NULL);
+	if (!repo) {
+		return NULL;
+	}
 
 	pldm_pdr_record *record = repo->first;
 	if (curr_record != NULL) {