diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index dabfea3..17530e4 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -1077,7 +1077,7 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag)
 
 int BIO_dgram_is_sctp(BIO *bio)
 {
-    return (BIO_method_type(bio) == BIO_TYPE_DGRAM_SCTP);
+    return (bio != NULL && BIO_method_type(bio) == BIO_TYPE_DGRAM_SCTP);
 }
 
 static int dgram_sctp_new(BIO *bi)

