mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-11 22:50:08 +00:00
fixed potential crash in remove_range
This commit is contained in:
@@ -818,7 +818,8 @@ impl FormattedText {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn remove_range(&mut self, range: Range<usize>) -> &mut Self {
|
||||
pub fn remove_range(&mut self, mut range: Range<usize>) -> &mut Self {
|
||||
range.end = range.end.min(self.text.len());
|
||||
self.text.drain(range);
|
||||
self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user