diff options
Diffstat (limited to 'src/list.h')
| -rw-r--r-- | src/list.h | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -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 | ||
