Skip to content

Commit eeab360

Browse files
jonasfjisoos
andauthored
Apply suggestions from code review
Co-authored-by: István Soós <[email protected]>
1 parent a4ad2f6 commit eeab360

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/lib/shared/utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ extension StringExt on String {
312312
/// ```
313313
String without({String prefix = '', String suffix = ''}) {
314314
var val = this;
315-
if (startsWith(prefix)) {
315+
if (prefix.isNotEmpty && startsWith(prefix)) {
316316
val = val.substring(prefix.length);
317317
}
318-
if (endsWith(suffix)) {
318+
if (suffix.isNotEmpty && endsWith(suffix)) {
319319
val = val.substring(0, val.length - suffix.length);
320320
}
321321
return val;

0 commit comments

Comments
 (0)