More state checks

This commit is contained in:
Thomas B 2012-03-22 20:22:26 +01:00
parent ef550eaec4
commit 5ab4071542

View file

@ -111,7 +111,7 @@ class rcube_kolab_contacts extends rcube_addressbook
// fetch objects from the given IMAP folder // fetch objects from the given IMAP folder
$this->storagefolder = kolab_storage::get_folder($this->imap_folder); $this->storagefolder = kolab_storage::get_folder($this->imap_folder);
$this->ready = !PEAR::isError($this->storagefolder); $this->ready = $this->storagefolder && !PEAR::isError($this->storagefolder);
// Set readonly and editable flags according to folder permissions // Set readonly and editable flags according to folder permissions
if ($this->ready) { if ($this->ready) {
@ -164,7 +164,7 @@ class rcube_kolab_contacts extends rcube_addressbook
*/ */
public function get_namespace() public function get_namespace()
{ {
if ($this->namespace === null) { if ($this->namespace === null && $this->ready) {
$this->namespace = $this->storagefolder->get_namespace(); $this->namespace = $this->storagefolder->get_namespace();
} }