aboutsummaryrefslogtreecommitdiff
path: root/src/serializerbinary.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/serializerbinary.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/serializerbinary.cpp b/src/serializerbinary.cpp
index d7143ab..23fb2b1 100644
--- a/src/serializerbinary.cpp
+++ b/src/serializerbinary.cpp
@@ -1,5 +1,6 @@
1#include "serializerbinary.h" 1#include "serializerbinary.h"
2#include "serializable.h" 2#include "serializable.h"
3#include "exceptions.h"
3 4
4SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading): 5SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading):
5 Serializer(bLoading), 6 Serializer(bLoading),
@@ -15,10 +16,14 @@ SerializerBinary::SerializerBinary(const char *sFileName, bool bLoading):
15 if (bLoading) 16 if (bLoading)
16 { 17 {
17 fhFile = fopen(sFileName, "rb"); 18 fhFile = fopen(sFileName, "rb");
19 if( fhFile == NULL )
20 throw FileException("Unable to open file: %s", sFileName );
18 } 21 }
19 else 22 else
20 { 23 {
21 fhFile = fopen(sFileName, "wb"); 24 fhFile = fopen(sFileName, "wb");
25 if( fhFile == NULL )
26 throw FileException("Unable to open file: %s", sFileName );
22 } 27 }
23} 28}
24 29