From f410d05c26745e9edb3fe565227c08bad2a84e7d Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Sat, 4 Feb 2017 17:26:55 +0100 Subject: [PATCH] Avoid empty 'len' --- src/core/DataFile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index feac8bda5f1..1c3e84ad9ed 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -915,9 +915,12 @@ void DataFile::upgrade_1_2_0_rc3() QDomElement el = list.item( i ).toElement(); for( int i = 0; !list.item( i ).isNull(); ++i ) { - patternLength = el.attribute( "len" ).toInt(); - steps = patternLength / 12; - el.setAttribute( "steps", steps ); + if( el.attribute( "len" ) != "" ) + { + patternLength = el.attribute( "len" ).toInt(); + steps = patternLength / 12; + el.setAttribute( "steps", steps ); + } } } }