aboutsummaryrefslogtreecommitdiff
path: root/src/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/list.h b/src/list.h
index 6d2246e..3979b63 100644
--- a/src/list.h
+++ b/src/list.h
@@ -871,6 +871,8 @@ namespace Bu
871 */ 871 */
872 value &first() 872 value &first()
873 { 873 {
874 if( core->pFirst->pValue == NULL )
875 throw Bu::ExceptionBase("Attempt to read first element from empty list.");
874 _hardCopy(); 876 _hardCopy();
875 return *core->pFirst->pValue; 877 return *core->pFirst->pValue;
876 } 878 }
@@ -881,6 +883,8 @@ namespace Bu
881 */ 883 */
882 const value &first() const 884 const value &first() const
883 { 885 {
886 if( core->pFirst->pValue == NULL )
887 throw Bu::ExceptionBase("Attempt to read first element from empty list.");
884 return *core->pFirst->pValue; 888 return *core->pFirst->pValue;
885 } 889 }
886 890