[ghex] hex-doc: Add sanity checks to _get_buffer and _get_file in public API
- From: Logan Rathbone <larathbone src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ghex] hex-doc: Add sanity checks to _get_buffer and _get_file in public API
- Date: Sun, 26 Jun 2022 18:55:27 +0000 (UTC)
commit f52d15b4eab0e65dbb7bc881c97d29b8ab5f2659
Author: Logan Rathbone <poprocks gmail com>
Date: Sun Jun 26 14:54:24 2022 -0400
hex-doc: Add sanity checks to _get_buffer and _get_file in public API
src/hex-document.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/src/hex-document.c b/src/hex-document.c
index 465cfe0..bde30d5 100644
--- a/src/hex-document.c
+++ b/src/hex-document.c
@@ -1885,6 +1885,8 @@ hex_document_get_undo_data (HexDocument *doc)
HexBuffer *
hex_document_get_buffer (HexDocument *doc)
{
+ g_return_val_if_fail (HEX_IS_DOCUMENT (doc), NULL);
+
return doc->buffer;
}
@@ -1900,6 +1902,8 @@ hex_document_get_buffer (HexDocument *doc)
GFile *
hex_document_get_file (HexDocument *doc)
{
+ g_return_val_if_fail (HEX_IS_DOCUMENT (doc), NULL);
+
return doc->file;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]