From 0ac94e3e7237660c8d506043f29515e20711a840 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 20 Oct 2014 22:49:46 +0200 Subject: [PATCH] CDBViewQuantity shouldn't crash in the editor. --HG-- branch : dfighter-tools --- code/nel/src/gui/dbview_quantity.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/code/nel/src/gui/dbview_quantity.cpp b/code/nel/src/gui/dbview_quantity.cpp index ad651f582..12dfce4b8 100644 --- a/code/nel/src/gui/dbview_quantity.cpp +++ b/code/nel/src/gui/dbview_quantity.cpp @@ -157,14 +157,17 @@ namespace NLGUI // *************************************************************************** void CDBViewQuantity::draw () { - // change text - sint32 val= _Number.getSInt32(); - sint32 valMax= _NumberMax.getSInt32(); - if(_Cache!=val || _CacheMax!=valMax) + if( _Number.hasValue() && _NumberMax.hasValue() ) { - _Cache= val; - _CacheMax=valMax; - buildTextFromCache(); + // change text + sint32 val= _Number.getSInt32(); + sint32 valMax= _NumberMax.getSInt32(); + if(_Cache!=val || _CacheMax!=valMax) + { + _Cache= val; + _CacheMax=valMax; + buildTextFromCache(); + } } // parent call