summaryrefslogtreecommitdiff
path: root/src/drumkitloader.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-19 22:59:50 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-19 22:59:50 +0200
commitbc4f25337e048db7d7ec86cfb116cc3768473ff5 (patch)
tree7828f7a54a14c6e4d605b021f81c280dba955df6 /src/drumkitloader.cc
parentabc0caf95536a4001615f863860a091d6bc55973 (diff)
More pointer sanity checks
Diffstat (limited to 'src/drumkitloader.cc')
-rw-r--r--src/drumkitloader.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc
index 45dcec3..be74624 100644
--- a/src/drumkitloader.cc
+++ b/src/drumkitloader.cc
@@ -81,13 +81,13 @@ void DrumKitLoader::thread_main()
unsigned int count = 0;
- if(!kit->isValid()) goto finish;
+ if(kit && !kit->isValid()) goto finish;
{ // Count total number of files that need loading:
Instruments::iterator i = kit->instruments.begin();
while(i != kit->instruments.end()) {
Instrument *instr = *i;
- if(!instr->isValid()) goto finish;
+ if(instr && !instr->isValid()) goto finish;
count += instr->audiofiles.size();
i++;
@@ -100,7 +100,7 @@ void DrumKitLoader::thread_main()
while(i != kit->instruments.end()) {
Instrument *instr = *i;
- if(!instr->isValid()) goto finish;
+ if(instr && !instr->isValid()) goto finish;
std::vector<AudioFile*>::iterator a = instr->audiofiles.begin();
while(a != instr->audiofiles.end()) {
@@ -113,7 +113,7 @@ void DrumKitLoader::thread_main()
#endif
AudioFile *af = *a;
- if(!af->isValid()) goto finish;
+ if(af && !af->isValid()) goto finish;
af->load();
loaded++;