From 1d9d0d6520e571879fc926c2e7e313769fdb1544 Mon Sep 17 00:00:00 2001 From: jonwd7 Date: Mon, 7 Nov 2016 08:14:24 -0500 Subject: [PATCH] [Mem] Misc compiler warning fixes --- src/gl/glproperty.cpp | 2 +- src/gl/gltexloaders.cpp | 2 +- src/widgets/uvedit.cpp | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gl/glproperty.cpp b/src/gl/glproperty.cpp index e47fb38f9..1ad9702cb 100644 --- a/src/gl/glproperty.cpp +++ b/src/gl/glproperty.cpp @@ -152,7 +152,7 @@ void PropertyList::del( Property * p ) QHash::iterator i = properties.find( p->type() ); - while ( i != properties.end() && i.key() == p->type() ) { + while ( p && i != properties.end() && i.key() == p->type() ) { if ( i.value() == p ) { i = properties.erase( i ); diff --git a/src/gl/gltexloaders.cpp b/src/gl/gltexloaders.cpp index 265bbb216..f59c991bc 100644 --- a/src/gl/gltexloaders.cpp +++ b/src/gl/gltexloaders.cpp @@ -1269,7 +1269,7 @@ bool texLoadCube( const QString & filepath, QString & format, GLuint & width, GL return false; } - bool success; + bool success = false; GLuint result; QBuffer f( &data ); diff --git a/src/widgets/uvedit.cpp b/src/widgets/uvedit.cpp index c9a8ece02..cbd5b9f26 100644 --- a/src/widgets/uvedit.cpp +++ b/src/widgets/uvedit.cpp @@ -764,7 +764,7 @@ bool UVWidget::setNifData( NifModel * nifModel, const QModelIndex & nifIndex ) isDataOnSkin = false; // Version dependent actions - if ( nif->getVersionNumber() != 0x14020007 ) { + if ( nif && nif->getVersionNumber() != 0x14020007 ) { coordSetGroup = new QActionGroup( this ); connect( coordSetGroup, &QActionGroup::triggered, this, &UVWidget::selectCoordSet ); @@ -787,6 +787,9 @@ bool UVWidget::setNifData( NifModel * nifModel, const QModelIndex & nifIndex ) connect( nif, &NifModel::rowsRemoved, this, &UVWidget::nifDataChanged ); } + if ( !nif ) + return false; + textures->setNifFolder( nif->getFolder() ); iShapeData = nif->getBlock( nif->getLink( iShape, "Data" ) );