[med-svn] [aghermann] 08/23: don't let current_profile dangle in SDirlevelStorableAdapter::discard_c_p

andrei zavada hmmr-guest at moszumanska.debian.org
Wed Jan 4 22:59:25 UTC 2017


This is an automated email from the git hooks/post-receive script.

hmmr-guest pushed a commit to tag 1.1.2
in repository aghermann.

commit 1343cc5444b8a7b5d5af206f3048404b2c49e755
Author: Andrei Zavada <hmmr at frdg>
Date:   Tue Jan 3 05:43:42 2017 +0200

    don't let current_profile dangle in SDirlevelStorableAdapter::discard_c_p
---
 upstream/src/aghermann/ui/dirlevel-storable-adapter.ii | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/upstream/src/aghermann/ui/dirlevel-storable-adapter.ii b/upstream/src/aghermann/ui/dirlevel-storable-adapter.ii
index 7d108d1..2892361 100644
--- a/upstream/src/aghermann/ui/dirlevel-storable-adapter.ii
+++ b/upstream/src/aghermann/ui/dirlevel-storable-adapter.ii
@@ -130,7 +130,14 @@ discard_current_profile()
                 return;
 
         auto todelete = current_profile;
-        current_profile = next(current_profile);
+        auto prec = prev(current_profile);
+        auto foll = next(current_profile);
+        current_profile =
+                (foll != profiles.end())
+                ? foll
+                : (current_profile != profiles.begin())
+                ? prec
+                : profiles.end();
         todelete->delete_file();
         profiles.erase( todelete);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git



More information about the debian-med-commit mailing list