Segmentation fault with unencrypted stream

Encryption information is not allocated in the struct when the stream is unencrypted. Referencing the unallocated element causes a segmentation fault. Added additional check.