Add early return check

This commit is contained in:
jikstra
2019-07-22 18:10:56 +02:00
parent f4a5ed498a
commit 76c353bf36

View File

@@ -50,7 +50,10 @@ pub unsafe fn dc_check_qr(context: &Context, qr: *const libc::c_char) -> *mut dc
qr_parsed
};
if !qr.is_null() {
if qr.is_null() {
return cleanup();
}
info!(context, 0, "Scanned QR code: {}", as_str(qr),);
/* split parameters from the qr code
------------------------------------ */
@@ -294,7 +297,6 @@ pub unsafe fn dc_check_qr(context: &Context, qr: *const libc::c_char) -> *mut dc
if !device_msg.is_null() {
dc_add_device_msg(context, chat_id, device_msg);
}
}
cleanup()
}