Prevent qr code generation lecture id is null.