diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
old mode 100644
new mode 100755
index 42e7decec188e4cbf76e94d4ef6771ebd11fc045..b539ac38ed82eedf7dc83e2cd98af50e86a4d317
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -75,6 +75,9 @@ void LLAvatarIconIDCache::load	()
 		LLUUID icon_id;
 		LLDate date;
 
+		if (line.length()<=uuid_len*2)
+			continue; // short line, bail out to prevent substr calls throwing exception.
+
 		std::string avatar_id_str = line.substr(0,uuid_len);
 		std::string icon_id_str = line.substr(uuid_len,uuid_len);