mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
Fix NPE when replacing unexisting strings
This commit is contained in:
parent
34b0813530
commit
42ff604f1e
@ -94,7 +94,9 @@ public class StringReplacer {
|
|||||||
String rightDelimiter) {
|
String rightDelimiter) {
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
String keyword = leftDelimiter + entry.getKey() + rightDelimiter;
|
String keyword = leftDelimiter + entry.getKey() + rightDelimiter;
|
||||||
src = src.replace(keyword, entry.getValue());
|
if (entry.getValue() != null && keyword != null) {
|
||||||
|
src = src.replace(keyword, entry.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user