fix(keycard_pairings): don't write the pairing file if content is empty (#4113)
Fixes https://github.com/status-im/status-desktop/issues/12342
This commit is contained in:
parent
ba5ed725ce
commit
de34ea37f2
|
@ -28,6 +28,10 @@ func (kp *KeycardPairings) GetPairingsJSONFileContent() ([]byte, error) {
|
|||
}
|
||||
|
||||
func (kp *KeycardPairings) SetPairingsJSONFileContent(content []byte) error {
|
||||
if len(content) == 0 {
|
||||
// Nothing to write
|
||||
return nil
|
||||
}
|
||||
_, err := os.Stat(kp.pairingsFile)
|
||||
if os.IsNotExist(err) {
|
||||
dir, _ := filepath.Split(kp.pairingsFile)
|
||||
|
|
Loading…
Reference in New Issue